Destroy specific entity when breaking blocks.

Started by Aituok on

Topic category: Help with modding (Java Edition)

Last seen on 23:02, 21. Feb 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Destroy specific entity when breaking blocks.

Hello. I have created a chair that consists of a model and a mob. The mob is transparent and a similar height to the chair, and it is inside the chair, giving it the appearance that you are sat on the chair. The mob spawns inside the chair when the chair is placed down. The issue is how to get the mob to despawn when the chair is broken. I have been trying all sorts of procedures for when the chair breaks, but I am unsure as to how to do this. I would like it so that when the chair is broken, the mob inside of it despawns. I have checked the forums and various YouTube videos with minimal success. Does anyone have a clear example as to how I can go about this?

Last seen on 23:02, 21. Feb 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Some things I have tried…
Fri, 02/17/2023 - 02:46

Some things I have tried. This is all within the chair model's breaking procedure:


Try #1Test #2Attempt #3

Last seen on 23:02, 21. Feb 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ATTENTION: I have found the…
Fri, 02/17/2023 - 03:54

ATTENTION: I have found the fix.

The "break" trigger only works if you break a block in SURVIVAL MODE. It does not count creative mode breaking as a trigger break. Therefore, I have made a condition that if the block is ever an air block, the entity taking up that space gets deleted.