minecraft:entity_placer for you with a switch.Get GodCraftOverview
minecraft:entity_placer is an item component: it goes in the components object of a custom item. Makes the item spawn an entity when used, like a spawn egg or a boat item.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
entity | Entity Reference | "" | The entity that appears when the item is used. |
use_on | Block Descriptor[] | none | Blocks the item may be used on. Leave it empty to allow any block. |
dispense_on | Block Descriptor[] | none | Blocks a dispenser may spawn the entity on. Leave it empty to allow any block. |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:entity_placer": {
"entity": "",
"use_on": [],
"dispense_on": []
}
}