主题
世界类动作
world_time
设置副本世界的时间。
javascript
action.world_time(时间)| 参数 | 类型 | 说明 |
|---|---|---|
| 时间 | String | day / night / noon / midnight,或 tick 值,或 HH:MM 格式 |
javascript
action.world_time('night')
action.time('18:00')别名:time
weather
设置副本世界的天气。
javascript
action.weather(天气类型)
action.weather(天气类型, 持续时间)| 参数 | 类型 | 说明 |
|---|---|---|
| 天气类型 | String | clear / rain / storm / thunder |
| 持续时间 | String | 可选,如 5min |
javascript
action.weather('storm')setblock
设置指定位置的方块类型。
javascript
action.setblock(位置, 方块类型)
action.setblock(位置, 方块类型, 数据=BlockData)| 参数 | 类型 | 说明 |
|---|---|---|
| 位置 | String | 坐标 x,y,z |
| 方块类型 | String | Bukkit Material 名称 |
| 数据 | String | 可选,BlockData 字符串(1.13+) |
javascript
action.setblock('10,64,10', 'STONE')
action.setblock('10,64,10', 'OAK_DOOR', 'data=facing=north,half=lower')explosion
在指定位置生成爆炸。
javascript
action.explosion(位置, 威力)
action.explosion(位置, 威力, 火焰=bool, 破坏=bool)| 参数 | 类型 | 说明 |
|---|---|---|
| 位置 | String | 坐标 x,y,z |
| 威力 | Float | 爆炸威力,默认 2.0 |
| 火焰 | Boolean | 是否产生火焰,默认 false |
| 破坏 | Boolean | 是否破坏方块,默认 false |
javascript
action.explosion('10,64,10', 4)别名:explode
gamerule
设置副本世界的 GameRule,仅影响当前副本世界。
javascript
action.gamerule(规则名, 值)| 参数 | 类型 | 说明 |
|---|---|---|
| 规则名 | String | Bukkit GameRule 名称 |
| 值 | String | true / false 或整数 |
javascript
action.gamerule('keepInventory', 'true')
action.gamerule('doDaylightCycle', 'false')常用规则:keepInventory、doMobSpawning、doDaylightCycle、doWeatherCycle、mobGriefing、naturalRegeneration
别名:set_gamerule
