Started by
Hogwash
on
Topic category: Help with Minecraft modding (Java Edition)
So, I have a locked chest and when I used a key on it the key disappears and the locked chest gets replaced by an unlocked version it (also there is a keyblade version of the key that uses durability instead of disappearing). I want the unlocked chest to spawn with custom loot table items but I'm not sure how to do it. Here is what I have so far:
Edited by Hogwash on Tue, 10/05/2021 - 05:07
Not sure if the image links worked: https://imgur.com/a/z1twr67
Bind the unlocked chest with a Gui and fill the gui with items you want
Then on the trigger block added you can randomize the items inside so they can be different any time
I'm guessing this would mean that if an item were set to slot 0 in the GUI then whenever it appears randomly in a chest it would always be in the same slot? That's a little annoying but beggars can't be choosers. How exactly would you implement the randomization though?
I don't understand what you said
Yes if you put in a slot it will always spawn with that item in that slot but as said just randomize the loot
This way you can change either item in slot and quantity to be placed in slot
Okay I understand but how would you randomize it? I'm a little confused on that part.
I use it randomized in my mod. I believe much funnier for someone finding your chest not knowing what's inside
Just an example, do as you wish
https://imgur.com/Perp3fw
Everytime i open the chest it keeps adding in another item. Do you know how I could fix that?
What means another ? Send me some screenshots please for the item and the procedure you are using
What should the trigger be? I have mine OnBlockRightClicked. This means that every time I open the chest again it will keep adding new items from the procedure. https://imgur.com/a/UpbX42T If I open the chests too much my game will crash so I want to know what trigger would make the item generation only happen once.
Of course, trigger must be when block added
It says that im missing dependencies
Nvm I fixed it but only 1 item spawns in the chests at a time, with various amounts of course.