Started by
TrueDiamond
on
Topic category: Help with Minecraft modding (Java Edition)
How to make a mob give us a drop if we feed it. For example, I fed the dog meat, and she gave us a bone
Topic category: Help with Minecraft modding (Java Edition)
How to make a mob give us a drop if we feed it. For example, I fed the dog meat, and she gave us a bone
Make a procedure with the global trigger 'player right clicks entity.' Use an if bracket to check if the item in the main hand of the player is meat. (Using an item compare function from the logic tab, and a 'item in main hand' function from the entity data tab).
If the item in the player's main hand is meat, spawn a bone item at the dog's position. (Using the 'spawn item/gem' function, from the world tab).
You will also likely want to use the 'shrink itemstack' function to decrease the number of items in the player's main hand, and the 'swing main hand' function to make the player's hand swing when they right click on the entity with the correct item.