Procedure to spawn entity when clicking an item on the ground

Started by flaviovittor on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure to spawn entity when clicking an item on the ground
Sat, 04/19/2025 - 12:06 (edited)

Hello. I made an entity and made an item that can be crafted, I want this item to generate my entity when I click with it on the ground, in the procedures tab I put "when player clicks on the with item" if "item in your main hand + target entity" = "item" do "spawn entity" but it is spawning the entity with any item, that is, if I click even with a twig the entity spawns, how do I solve this?  How do I make it work only with the item I choose?

 

Edited by flaviovittor on Sat, 04/19/2025 - 12:06
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just to be sure, is the…
Sat, 04/19/2025 - 15:18

Just to be sure, is the spawning part of your procedure in the Do part of the If Do?

Try moving your procedure to the item's "when right-click on block" trigger, than you would only need to leave the spawning the mob.