Entity Documentation - minecraft:environment_sensor
minecraft:environment_sensor
creates a trigger based on environment conditions.
Parameters
Name | Default Value | Type | Description |
---|---|---|---|
triggers | not set | List | The list of triggers that initiate when the environment conditions match the given filter criteria. |
Name | Default Value | Type | Description |
---|---|---|---|
event | not set | string | The event to run when the conditions are met. |
filters | not set | List / Filter | The list of conditions for this trigger to initiate. |
target | self | string | The target of the event. |
Example
"minecraft:environment_sensor":{
"triggers":[
{
"filters":{
"all_of":[
{
"test":"is_daytime",
"value":true
},
{
"test":"has_target",
"operator":"==",
"value":false
}
]
},
"event":"minecraft:fox_configure_docile_day"
}
]
}
Vanilla entities examples
fox
"minecraft:environment_sensor": {
"triggers": [
{
"filters": {
"all_of": [
{ "test": "weather_at_position", "operator": "!=", "value": "thunderstorm" },
{ "test": "is_daytime", "value": true }
]
},
"event": "minecraft:fox_configure_day"
},
{
"filters": {
"all_of": [
{ "test": "weather_at_position", "operator": "!=", "value": "thunderstorm" },
{ "test": "is_daytime", "value": false }
]
},
"event": "minecraft:fox_configure_night"
}
]
}
Vanilla entities using minecraft:environment_sensor
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈