Right-click on a mob with an item

Started by Kotoro on

Topic category: Help with modding (Java Edition)

Last seen on 19:03, 11. Aug 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Right-click on a mob with an item

Hello ! My situation is more complicated than the title says:

I've created an item. I'd like it if, when I right-click on a VANILLA mob (it's important to specify this, because I don't know if you can add procedures to vanilla mobs...), it disappears to make one of my new mobs appear.
Finally, my item (which is a book) would lose one point of durability.
Also, how do I get the exact mob?

Can you help? It's been so long since I last used MCreator that I'm totally rusty :/.

PS: There's a left-click procedure, but I'd rather not have to use it.

Last seen on 21:06, 17. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This should be able to help…
Thu, 07/25/2024 - 11:48

This should be able to help you

The procedure needed

(Book is the item the entity is clicked with)

(Pig is the original entity

(Creeper is the converted entity)

You don't need to attach this to an entity, because the global trigger will activate when the player clicks on the entity, so you just have to leave it unattached to anything and it will work.

Last seen on 19:03, 11. Aug 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wow, I'm going to try that!…
Thu, 07/25/2024 - 12:32

Wow, I'm going to try that! You're my savior! I always thought that procedures had to be attached to a trigger to work.

Last seen on 19:03, 11. Aug 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It works! Thanks again! <33
Thu, 07/25/2024 - 13:06

It works! Thanks again! <33

Last seen on 21:06, 17. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're welcome! :D
Thu, 07/25/2024 - 14:27

You're welcome! :D