Started by
Redtrakinas1
on
Topic category: Help with Minecraft modding (Java Edition)
resuming i need help with an entity that if you collide with it the items change gui in the inventory example: the sword in slot 1 and if i collide with the mob the sword will change to slot 9 or something like that but the slot that it will change is random does somebody have some advise of how to make an procedure like that in mcreator?
I did something similar for shulker-items that spring to your hand when you need them. It'd be a bit trickier to randomize inventory slots, but hardly impossible. Try something like this:
...Also keep in mind that the number of items in a stack is independent of all the other attributes. (Name, enchantments, etc.) Meaning if you're swapping stackable items, you'll want to add two more number variables to keep track of the amount of items in each stack, otherwise it'll default to 1.