Started by
SeriousMANBOT
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a dinosaur mod. One of them is tameable right now, with raw chicken.
I've made it so that right clicking the mob with raw chicken in my mainhand removes the item from my inventory, but I cant figure out how to make it heal the entity. If anyone knows how and can help, I'd greatly appreciate it.
In terms of taming, as well as breeding for that matter. I think it automatically sets the taming item to heal the mob.
But, if not, and in more general terms, while editing the entity, under "Triggers" there should be a spot that says "When right clicked on entity". Should be in the center of the screen
Simply make a procedure that checks if the item in the main hand of the player is the right item, then have it heal the entity. Probably by giving it instant_health for a short second. Use "Source Entity" as the player and "Event/Target Entity" as the entity being right clicked.
I use version 2020.2 so there's no "Source Entity" for me
Is there any other way?
either way thank you for the help
Hm, Not too sure if I know a way then. You could possibly use a couple of the "Execute command" procedure blocks in the world management section. With commands like
execute as entity @p[limit=1,nbt={SelectedItem:{id:"minecraft:chicken",Count:1b}}] run clear @s chicken 1 | to remove a raw chicken from the player.
And
execute if entity @p[limit=1,nbt={SelectedItem:{id:"minecraft:chicken",Count:1b}}] run effect give @e[distance=0..0.01] instant_health 20 1
To heal the entity if the closest player is holding raw chicken when right clicked (Though, this would also allow for another player to be holding chicken and then a different player could activate it for them)
Im not exactly sure how well this would work, if at all. But I think it might.
I also mightve made mistakes in those commands themselves, but yeah. I think the way to go with this may be command based.
Maybe https://mcreator.net/plugin/64513/minecraft-1122-generator, not sure if it supports this feature, though
thank you both, although the commands are for 1.14+ and my mods are for 1.12.2
I'll see if I can use both of your advice