Lootboxes
Loot boxes like in Counter-Strike. Multiplayer-friendly (opened via Enderchest).
First, there will be no updates of this datapack unless I will need it myself, but feel free to modify it yourself.
Everything should be commented and hopefully easy to understand. I strongly belive it is
Many things should be easy to adjust; check data\lbx\function\load.mcfunction and data\lbx\loot_table\lootbox.json in first place.
What does it do?
This datapack adds custom lootbox with Counter-Strike like animation which can be open by opening an enderchest with a music disc in main hand.
Features
- Case opening
- StatTrak
- Trade ups

I used normal disc 5, so player can get this key either by going into Ancient City or craft it with custom recipe from diamonds

StatTrak
Items also have 10% chance to have StatTrak on them (just like in CS). I didn't make it locked to a player. They count how many kills (of players and mannequins (testing)) were made using them and show who was the last killer. It's called TrackKills in game as StatTrak is actually trademarked.

Trade ups
Trade up feature is included too. You can use /trigger tradeup to combine what you already got from the case and get something from a better tier.

This datapack is probably totaly unbalanced. I haven't tested it in practise yet. On picture above there is everyting what's curently in loot table.
There is few items unachievable in survival
I made 2 versions of chances
- CS - just like in Counter Strike, they are rough
- x3 - The other version has a lot higher odds, each lower level has a 3 times higher chance of being dropped than the previous one

It should be safe? There wasn't enough tests.
- I took into consideration for player to take away items from enderchest, drop them, put them in a bundle
- If something was put in it will be returned
- Player can leave the server and when he come back the opening will be resumed
- Player enderchest is stored in data storage
How it works?
- Players enderchest is stored and cleared
- First, case is quickly opening
- Then it slows down
- Stops, has 50% chance to move one more time then gives prize
- Players enderchest is restored
Test
There is a command designed to test this datapack.
/function lbx:test
It gives items for crafting the key and chests with every item from loot table.