Started by
Aituok
on
Topic category: Help with Minecraft modding (Java Edition)
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?
Some things I have tried. This is all within the chair model's breaking procedure:
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.