1. Wiki
  2. /Entities
  3. /minecraft:interact

minecraft:interact

Don't want to write this by hand? GodCraft sets minecraft:interact for you with a switch.Get GodCraft

Overview

minecraft:interact is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Defines what happens when a player uses an item or clicks on the entity, like shearing a sheep. Each interaction can use up the item, give items back and fire an event.

Fields

FieldTypeDefaultDescription
interactionsInteractionData[]noneList of interactions, each with its conditions, button text, item changes and event.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:interact": {
    "interactions": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more