概述
添加区域(Zones),当实体进入、离开或处于其中时,可执行命令。
提供 3 种事件:
- 进入时(On Enter):实体进入区域时执行一次
- 每刻(On Tick):实体在区域内的每一刻都会执行
- 离开时(On Leave):如果实体上一刻在区域内而此刻不在,则触发此事件
使用方法
使用区域角块(Zone Corner)指定或编辑区域的角落,然后使用区域扳手(Zone Wrench)来删除该区域或配置每个事件执行的命令。这些命令由触发事件的实体身份执行。
这些物品可以在创造模式的“操作员”标签页中找到,并提供带有描述的提示文本。
依赖项
- owo-lib
- Quilted Fabric Api
- Lucko's fabric-permission-api (已嵌入)
技术细节
模组使用标签来存储实体所在的区域。标签格式与原版命令语法不兼容,这意味着无法通过命令移除这些标签。
只要区域未被编辑且模组添加的标签未被篡改,以下情况被视为错误:
- 对于每个进入事件,必须恰好有一个对应的离开事件
- 实体在未离开的情况下不能两次进入同一个区域
- 离开事件后不会执行任何刻度事件
- 即使实体跨维度传送、重新连接或改变其维度/大小,离开事件始终会执行
Overview
Adds Zones which can execute commands when an Entity enters, leaves, or is in one.
There are 3 events available:
- On Enter: Executed once when the entity entered the Zone
- On Tick: Executed every tick the entity is in the Zone
- On Leave: Executed when a entity which was in a Zone the tick before isn't in it anymore
Usage
Use the Zone Corner to specify or edit the corners of a Zone and use a Zone Wrench to then delete it or configure the commands executed on each event. The commands are executed as the entity who triggered the event.
The items can be found in the Operator creative tab and provide tooltips with descriptions
Dependencies
- owo-lib
- Quilted Fabric Api
- Lucko's fabric-permission-api (Embedded)
Technical stuff
The mod uses tags to store the zones an entity is in. The tag format is incompatible with the vanilla command syntax, this means that those tags cant be removed using commands
It is considered a bug if the following stuff is violated, as long as the Zone isn't edited in between, and the tags added by the mod aren't manipulated:
- For each enter event there has to be exactly one leave event
- No entity can enter a zone twice without leaving in between
- No tick events are executed after a leave
- The leave event is always executed, even if the entity teleports across dimensions, rejoins, changes its dimensions/size...
评论 0
登录后参与评分
还没有评论,来抢沙发吧