How can I despawn a mob if the Entity is the player? Working on a Dr. Stone mod.

Started by James Sylar on

Topic category: Help with MCreator software

Last seen on 05:23, 7. Jul 2021
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I despawn a mob if the Entity is the player? Working on a Dr. Stone mod.

Hello everyone, today I got the idea of making a mod about the manga/anime of Dr. Stone, and I think its going pretty good, at least with the basic idea (I might make a post once I solve this) but I'm having problems getting rid of a mob with procedures, since the Entity referenced is the player. 

Explanation: I have a mob that represents the pretrified people, it doesn't do nothing but stand there. But once right-clicked with a bottle full of Nitic Acid, it triggers a procedure that changes the nitric acid's bottle for an empty one, and summons a villager at the coordinates. I tried to put "despawn the entity" and related options, but since the entity who clicked the statue is the player, it tries to despawn or kill them, not the statue. I even tried to call a different procedure at the location, but apparently the entity is inherited because it still killed me. 

It would be easier if I was using a block instead of an entity, the options to delete them based on their position are right there in the menu, but there is nothing like that for the entities. I consider putting a global variable that records the X Y and Z of the statue with each tick, but that's a bit too far advanced from what I know how to do, and there will be multiple statues at the same time in the world, so it wouldn't work either way. 

Does anyone know some combination of procedure options that I'm missing or maybe a code that I could use to delete that one specific statue that I just clicked, instead of me? Thank you in advance, have a good night. 

 

 

 

Last seen on 05:23, 7. Jul 2021
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, I might have not…
Mon, 12/30/2019 - 18:11

Yeah, I might have not explained myself, I want to despawn the mob that the player clicked, not the player, but the referenced entity is the player, since it was the one that made the click. I want to make that mob the reference entity or kill it in other way. 

Last seen on 03:19, 17. Feb 2024
Joined May 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a ranged item, and add…
Sun, 01/05/2020 - 13:34

Make a ranged item, and add a procedure that "If entity - (your mob)" gets hit by the bullet, despawn entity and do what you want

Last seen on 14:04, 10. Apr 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just execute command "kill …
Thu, 08/06/2020 - 07:54

Just execute command "kill @p" and that will kill the player (if the bullet is not shot by a player)