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