Entity Documentation - minecraft:rail_sensor
minecraft:rail_sensor
defines the entity's behavior when passing over an activated or deactivated rail.
Parameters
Name | Default Value | Type | Description |
---|---|---|---|
check_block_types | False | Boolean | If true, on tick the entity will trigger its on_deactivate behavior |
eject_on_activate | True | Boolean | If true, the entity will eject all of its riders when it passes over an activated rail |
eject_on_deactivate | False | Boolean | If true, the entity will eject all of its riders when it passes over a deactivated rail |
on_activate | not set | JSON Object | Event to call when the rail is activated |
on_deactivate | not set | JSON Object | Event to call when the rail is deactivated |
tick_command_block_on_activate | True | Boolean | If true, command blocks will start ticking when passing over an activated rail |
tick_command_block_on_deactivate | False | Boolean | If false, command blocks will stop ticking when passing over a deactivated rail |
Example
"minecraft:rail_sensor":{
"check_block_types": false,
"eject_on_activate": true,
"eject_on_deactivate": false,
"on_activate": {
"event": "minecraft:command_block_activate"
}
"on_deactivate": {
"event": "minecraft:hopper_activate"
},
"tick_command_block_on_activate": true,
"tick_command_block_on_deactivate": false
}
Vanilla entities examples
minecart
"minecraft:rail_sensor": {
"eject_on_activate": true
}
Vanilla entities using minecraft:rail_sensor
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for