Entity takes damage from GUI button

Started by Pickle's Modding on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity takes damage from GUI button

I'm making a Minecraft mod with Movie Props and the props are entities for easier animations and rotations and stuff.

I have added a tool to the mod that will let you open an inventory for the entity (Used for changing textures, placing items, etc) and I added a button in the inventory to "Destroy the Prop", I want it to deal damage and kill the prop, so it drops its spawn egg on death, but I have no idea how to code that and can't find anything to help. Does anyone know how I would do this? And thank you in advance.