minecraft:on_placed for you with a switch.Get GodCraftOverview
minecraft:on_placed is a block component: it goes in the components object of a custom block. Runs a block event right after the block is placed. This is an older event style; scripts are the newer way.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
condition | String | none | A Molang check that must be true for the event to run. |
event | String | none | Name of the block event to run. |
target | String | "self" | Who the event acts on, like "self" or "other". |
Example
Inside the components object of BP/blocks/<name>.json (values are the defaults or placeholders):
BP/blocks/<name>.json
{
"minecraft:on_placed": {
"condition": "",
"event": "",
"target": "self"
}
}