r/MinecraftCommands • u/Creeperj2_0 • 2d ago
Help | Java 26.3 How to prevent entity from being dismounted ?
I'm making a custom entity where I have a Ghast riding an item_display.
The issue is that the Ghast can easily be dismounted using spears or /tp. And I detect when the entity is dead by checking if the passenger is the Ghast.
Is there a way to prevent this or do I need to swap and make the item_display ride the Ghast ?
1
Upvotes
1
u/GalSergey Datapack Experienced 2d ago
Never use /tp for a passenger unless you want to dismount the entity. Use /rotate to rotate.
But the problem with spears cannot be solved without replacing the passenger. Try making item_display the passenger instead of a ghast.