minecraft:nameable for you with a switch.Get GodCraftOverview
minecraft:nameable is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets players give the entity a custom name, for example with a name tag. You can also run events when it gets a special name, like the "jeb_" trick on sheep.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
allow_name_tag_renaming | Boolean | "true" | If true, players can rename the entity with a name tag. |
always_show | Boolean | "false" | If true, the name floats above the entity even when you are not looking at it. |
default_trigger | String | none | Event to run whenever the entity is given any name. |
name_actions | JSON Object | none | Special names and the events each one runs when the entity receives it. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:nameable": {
"allow_name_tag_renaming": "true",
"always_show": "false",
"default_trigger": "",
"name_actions": {}
}
}