Is possible to despawn a mob when you click it with an item?

Started by SuperMalvado592 on

Topic category: Advanced modding

Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is possible to despawn a mob when you click it with an item?
Fri, 06/21/2019 - 19:49 (edited)

Hey.

I'm having problems with finding how to do something. I've wanted to use an "item A" to spawn a Mob when you click on the ground, and to give you "item B" (already done) .

Then use "item B" to despawn the Mob when you click on it, and to give you the "item A".

I'm using MCreator 1.8.3 (minecraft 1.12.2) and I've done everything but the despawn of the mob. I'm using procedures to make these events.

Please, help if it is possible and you know how to do it. THANKS

Edited by SuperMalvado592 on Fri, 06/21/2019 - 19:49
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It doesn't matter. I've…
Sat, 06/22/2019 - 20:55

It doesn't matter. I've already found a solution. :D

Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
PLEASE HOW DID YOU DO IT I…
Fri, 04/03/2020 - 18:20

PLEASE HOW DID YOU DO IT I NEEEEEEEEED TO KNOW

Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well, I did it, but it is…
Fri, 04/03/2020 - 20:12

Well, I did it, but it is hard to do it. I used the code from another article, but it had some bugs, and it restarts the code when opening again the mob to edit something, like the name, for example. So, having this bugs, I wasn't happy with the result, so I change it to something easier. What I did was to change the button. Instead of using the right click to interact, I used the left click. If MCreator hasn't changed much (I haven't used it for a while), the item should have a function or event that is called "When hurt a mob" or something like that, so just put in a function to detect if the mob hit was the mob you want to despawn and if it is, just put the new function or block that says "despawn" or put a set life to 0. Hope it is usefull, if you need the other article that I mentioned at the start to do the first thing I tried, just tell me and I will search for it, I think I have it somewhere in my computer.