动作(Actions)
什么是 actions?
动作是指 事件 被触发时所执行的操作.
动作列表:
play_sound
stop_sound
execute_commands
play_particle
shoot_particle
play_effect
increment_durability
decrement_durability
decrement_usages
increment_amount
decrement_amount
drop_exp
feed
replace_properties
give_item
replace_near_blocks
replace_block
glow_near_blocks
multiple_break
potion_effect
remove_potion_effect
explosion
damage_near_entities
damage_entity_in_sight
damage_entity
increment_player_stat
decrement_player_stat
cancel
target_potion_effect
target_remove_potion_effect
play_totem_animation
set_block
place_furniture
drop_item
延迟
同时执行多组同一动作
动作权限
动作的配置列表
使用在线编辑器可以更轻松地创建文件.
📄文件编辑器play_sound:
name: itemsadder:ambient.creepy
volume: 1
pitch: 1
stop_sound:
name: "itemsadder:music_disc.cdk_sunday"
execute_commands:
first_example:
command: 'tellraw {player} {"text":"wow you did something!","color":"gold"}'
as_console: true
second:
command: 'help'
as_console: false
third:
command: 'give {player} diamond'
as_console: true
play_particle:
name: "ENCHANTMENT_TABLE"
# 发射粒子 (适用于武器以及法杖)
shoot_particle:
name: FLAME
distance: 7
play_effect:
name: SMOKE
increment_durability:
amount: 10
decrement_durability:
amount: 10
decrement_usages:
amount: 1
increment_amount:
amount: 1
decrement_amount:
amount: 1
drop_exp:
chance: 50
min_amount: 1
max_amount: 3
# 原版恢复饥饿值详情:
# https://minecraft.gamepedia.com/Hunger#Food_level_and_saturation_level_restoration
feed:
amount: 6
saturation: 2 # <---可选项,默认为0
# 复制另一个物品的属性,应用至当前物品
# 目前你只能使用 custom_model_data 来进行此操作,更多类型将会在未来更新
replace_properties:
custom_model_data:
copy_from_item: "itemsadder:closed_lightsaber"
restorable: true
give_item:
item: empty_cup
amount: 1
# 当你交互或破坏方块的时候使周围的特定方块替换为另一种特定方块(例如,该示例将岩浆替换为黑曜石)
replace_near_blocks:
radius:
x: 2
y: 2
z: 2
from: LAVA
to: OBSIDIAN
decrement_durability: 8
no_physics: false #default is false
# 在你交互或破坏方块的时候使周围的特定方块发光
glow_near_blocks:
decrement_durability:
amount: 1
radius:
x: 50
y: 50
z: 50
material: DIAMOND_ORE
# 当你交互或破坏方块的时候能够额外破坏周围的方块(例如,在该示例中,挖掘掉一个方块将会使其周围 3x3 范围的方块都掉落 )
multiple_break:
keep_ores: true
drop_all_blocks:
enabled: true
need_silk_touch: true
size: 3
depth: 3
potion_effect:
type: UNLUCK
duration: 100
amplifier: 0
remove_potion_effect:
type: GLOWING
explosion:
power: 2
fire: true
break_blocks: true
# 使你周围的实体受到伤害
damage_near_entities:
entity_groups:
- HOSTILE
- PLAYERS
- PASSIVE
damage: 4
range: 7
# 使你注视的实体受到伤害
damage_entity_in_sight:
damage: 4
distance: 7
# 在该事件中能够使实体受到伤害(例如,攻击,交互或 item_hit_entity 事件)
damage_entity:
damage: 4
# 该属性能够允许你为 自定义玩家数据HUD 的 数值 进行减少(例如:预置物品中的愈合结晶)
# 该示例中作用的 HUD 为 "itemsadder:mana_bar"
increment_player_stat:
name: "itemsadder:mana_bar"
amount: 1
# 该属性能够允许你为 自定义玩家数据HUD 的 数值 进行增加(例如:预置物品中的愈合结晶)
# 该示例中作用的 HUD 为 "itemsadder:mana_bar"
decrement_player_stat:
name: "itemsadder:mana_bar"
amount: 1
# 取消事件的特殊操作(调用此动作的事件)
cancel: true
# 添加对目标实体的药水效果(攻击、互动……)
target_potion_effect:
type: GLOWING
duration: 70
amplifier: 15
# 移除对目标实体的药水效果(攻击、互动……)
target_remove_potion_effect:
type: GLOWING
play_totem_animation: animatedtitles:bruh
set_block:
block: rocks
target: RELATIVE
decrement_amount: true
place_furniture:
furniture: furniture
decrement_amount: true
drop_item:
item: 2d_furniture
chance: 99.9
max_amount: 3
min_amount: 1
最后更新于