主题
玩家类动作
teleport
传送玩家到指定位置。
javascript
action.teleport(选择器, 位置)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 位置 | String | x,y,z / x,y,z,yaw,pitch / spawn / world_spawn |
javascript
action.teleport('@all', '10,64,10')
action.tp('@trigger', 'spawn')别名:tp
give_item
给予玩家原版物品。
javascript
action.give_item(选择器, 物品ID, 数量)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 物品ID | String | Bukkit Material 名称 |
| 数量 | Int | 默认 1 |
javascript
action.give_item('@trigger', 'DIAMOND', 5)别名:give
give_mm
给予玩家 MythicMobs 物品。
javascript
action.give_mm(选择器, MM物品ID, 数量)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| MM物品ID | String | MythicMobs 物品 ID |
| 数量 | Int | 默认 1 |
javascript
action.give_mm('@trigger', 'FireSword', 1)别名:give_mythic_item
heal
治疗玩家。
javascript
action.heal(选择器)
action.heal(选择器, 治疗量)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 治疗量 | Double | 可选,不填则满血 |
javascript
action.heal('@all')
action.heal('@trigger', 10)gamemode
设置玩家游戏模式。
javascript
action.gamemode(选择器, 模式)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 模式 | String | survival / creative / adventure / spectator,或 0/1/2/3 |
javascript
action.gamemode('@all', 'adventure')别名:gm
cast_skill
让目标玩家施放 MythicMobs 技能。
javascript
action.cast_skill(选择器, 技能名)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 施法者 |
| 技能名 | String | MythicMobs 技能名称 |
javascript
action.cast_skill('@trigger', 'HealAura')别名:cast_mm_skill
revive
复活死亡状态的玩家。
javascript
action.revive(选择器)javascript
action.revive('@all')别名:resurrect
clear_inventory
清空玩家背包。
javascript
action.clear_inventory(选择器)javascript
action.clear_inventory('@all')别名:clear_inv
give_exp
给予经验值或经验等级。
javascript
action.give_exp(选择器, 数量)
action.give_exp(选择器, 数量, 模式=level)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 数量 | Int | 经验值数量 |
| 模式 | String | 可选,level 表示给等级 |
javascript
action.give_exp('@trigger', 100)
action.exp('@trigger', 5, 'mode=level')别名:exp
set_food
设置玩家饥饿值。
javascript
action.set_food(选择器, 饥饿值)
action.set_food(选择器, 饥饿值, 饱和度)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 饥饿值 | Int | 0-20 |
| 饱和度 | Float | 可选,0-20 |
javascript
action.set_food('@all', 20, 20)别名:food
set_fly
设置玩家飞行状态。
javascript
action.set_fly(选择器, 是否开启)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 是否开启 | String | true / false,默认 true |
javascript
action.set_fly('@trigger', 'true')别名:fly
remove_item
从玩家背包移除指定物品。
javascript
action.remove_item(选择器, 物品ID, 数量)| 参数 | 类型 | 说明 |
|---|---|---|
| 选择器 | String | 目标玩家 |
| 物品ID | String | XMaterial 名称(跨版本兼容) |
| 数量 | Int | 默认 1 |
javascript
action.remove_item('@trigger', 'IRON_INGOT', 3)别名:take_item
