Started by
Cromo
on
Topic category: Help with Minecraft modding (Java Edition)
Hi!
Today I came to ask for help to make some things for my mod. Anyone who can help, I'll be very grateful!
The first is: how do I get vanilla Minecraft entities to drop items from my mod?
The second: how can I, specifically, when I press a key with an item in my hand, something specific happen?
However, only when the item is in my hand.
I'm almost sure that for entities to drop items from your mod it's only necessary to change their loot tables, I don't think it's difficult I remember just having to select the type of loot table for entity and put the name of the desired entity
Ex. If you want to change the loot table of a chicken just create a new loot table select entity and put in the name ''chicken'', but be clear that it will only drop what was put there and not what normally drops so if you still want it to drop feathers you need to put that in your new loot table too
The second can be done with procedures and is very simple, just put to identify the inten on the player's hand
First: you could use a loot table for a vanilla mob like this
https://www.mediafire.com/view/bxr3g189fklo0cb/image%25287%2529.png/file
This should make a chicken have to drop a grass block (although it might completely remove the previous loot table)
Second : Use key binding to make it that when key pressed (or released) then do a procedure that checks for a specific item in your hand and then does something that you want it to do
Like this : https://www.mediafire.com/view/pfqwehud1mrc7wy/image%25288%2529.png/file
And this : https://www.mediafire.com/view/8wsv9lqkaus4fw4/image%25289%2529.png/file
making sure to replace the item (diamond) and what happens (replacing the drop diamond)
Thanks for your help! You are amazing!
another way to do the mob item drop make make a procedure that uses the Entity Dies Trigger, the an If Entity Exists block.