Started by
lawpash
on
Topic category: Help with Minecraft modding (Java Edition)
How would I go about making an item that summons an entity by right-clicking, then when right clicking the item again the entity goes “back into the item”(despawns until the item is right-clicked again)?
Edit: For context, like how you summon a pet in Terraria.
Edited by lawpash on Sun, 05/21/2023 - 04:42
When right-click on block position (trigger)
spawn entity *your entity* at x y z
set item in main hand of event/target Entity to *result of using*
for the entity to item
when right click (on entity)
despawn event/target entity
spawn gem/item *your item* at x y z pickup delay *your value* despawn *you decide*
the ** is for values you need to specify yourself. This code is not tested but the blocks exist in MCreator