minecraft:interact for you with a switch.Get GodCraftOverview
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
| Field | Type | Default | Description |
|---|---|---|---|
interactions | InteractionData[] | none | List 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": []
}
}