工具
版本:5
功能
- 全局、实体和玩家函数
- 朝指定方向移动实体
- 按实体存储数据
- 常量分数
- 玩家分数 ID
- 谓词
- 物品修饰符
- 实体标签
- 宏函数
- 自定义使用余量
命令
全局
清除所有玩家的聊天:
/function utils:global/clear_chat
隐藏侧边栏:
/function utils:global/hide_sidebar
实体
驱散实体/生物:
/execute as @n[type=zombie] run function utils:entity/despawn
重置实体/生物/玩家的所有属性:
/execute as @n[type=zombie] run function utils:entity/reset_all_attributes
完全治疗:
/execute as @n[type=iron_golem] run function utils:entity/heal_full
玩家
清除玩家的聊天:
/function utils:player/clear_chat
重置经验值(点数和等级):
/function utils:player/xp/reset
获取所有经验点数:
/function utils:player/xp/get_all_points
该函数返回所有经验点数,并保存在分数 utils.player.xp.total_points 中。
虚空世界随机传送:
/function utils:player/random_tp
运动
function utils:motion/calc
summon fireball ^ ^ ^.5
execute store result entity @n[type=fireball] Motion[0] double -0.00025 run scoreboard players get @s utils.motion.mx
execute store result entity @n[type=fireball] Motion[1] double -0.00025 run scoreboard players get @s utils.motion.my
execute store result entity @n[type=fireball] Motion[2] double -0.00025 run scoreboard players get @s utils.motion.mz
或者你可以使用存储和宏方法:
function utils:motion/storage {"value":"-0.00025"}
summon fireball ^ ^ ^.5
data modify entity @n[type=fireball] Motion set from storage utils:motion motion
按实体存储数据
创建数据
有两种方式可以创建或将数据添加到路径,set 和 append,当你使用 set 时,路径的绝对值将是 data 参数,
而对于 append,路径将是一个数组,并将追加数据参数。
# 绝对值
/function utils:entity/storage/set {"path":"lives","data":3}
/function utils:entity/storage/set {"path":"name","data":'"lullaby6"'}
# 数组
/function utils:entity/storage/append {"path":"deaths","data":1}
/function utils:entity/storage/append {"path":"deaths","data":2}
/function utils:entity/storage/append {"path":"deaths","data":3}
使用实体的数据运行函数
当你使用 entity/storage/function 时,来自实体存储的所有数据/参数将像宏参数一样被接收。
/function utils:entity/storage/function {"function":"namespace:say_lives"}
say_lives.mcfunction 文件:
$say $(lives)
移除数据
# 绝对值
/function utils:entity/storage/remove/data {"path":"lives"}
/function utils:entity/storage/remove/data {"path":"name"}
# 数组
/function utils:entity/storage/remove/first {"path":"deaths"}
/function utils:entity/storage/remove/index {"path":"deaths","index":1}
常量
存在从 0 到 1000 的常量。
你可以通过运行以下命令来检查和获取常量的值:
/scoreboard players get <number> utils.const
用法示例:
/scoreboard players get 1 utils.const
玩家分数 ID
获取玩家分数 ID:
/scoreboard players get @s utils.player.id
谓词
- can/see_sky
- has/effect/
<effect_name>(speed, regeneration, ...) - has/passenger
- in/biome/
<biome_name> - in/structure/
<structure_name>(village, desert_pyramid, trial_chambers, ...) - in/dimension/
<dimension_name>(overworld, the_nether, the_end) - in/light/
<level>(0, 5, 10, 15, 0-5, 5-10, ...) - is/raining
- is/thundering
- is/baby
- is/falling
- is/flying
- is/ground
- is/on_fire
- is/riding
- is/sneaking
- is/sprinting
- is/swimming
- random/
<chance><0.1 (10%), 0.5 (50%), ...>
示例:
/execute as @s if predicate utils:is/on_fire run say I am on fire D:
物品修饰符
- count
- count/add/
<number> - count/remove/
<number> - count/set/
<number>
- count/add/
- enchantment_glint_override/
<boolean> - max_stack_size/
<number> - rarity/
<rarity_name> - remove_component/
<item_component_name>(use_cooldown, enchantments, max_stack_size, ...) - repair_cost/
<number> - tooltip/
<tooltip_name>/<show | hide> - use_cooldown/
<time>(1s, 2s, 1m, 1h, ...) - damage
- damage/add/0.
<number> - damage/set/0.
<number>
- damage/add/0.
- clear_bundle
- clear_container
- death_protection
- enchant_randomly_compatible
- enchant_randomly
- furnace_smelt
- glider
- hide_additional_tooltip
- hide_tooltip
- non_consumable
- one_use
- remove_container_loot
- repair
- unbrekeable
示例:
/execute if items entity @s weapon.mainhand minecraft:raw_iron run item modify entity @s weapon.mainhand utils:furnace_smelt
实体标签
- all_boats
- animals
- aquatics_animals
- aquatics_real_animals
- aquatics
- arthropods
- boats_with_chest
- boats
- bosses
- cows
- end
- fishs
- flyers_hostiles
- flyers
- horses
- hostiles
- humanoids
- illagers
- monsters
- nether
- neutrals
- passives
- piglins
- proyectiles
- real_animals
- rideables_animals
- rideables
- slimes
- spiders
- tameables
- undead
- villagers_hostiles
- villagers
- zombiess
- team_player
示例:
/effect give @e[type=#utils:team_player] glowing 1 0
许可证
MIT
? 服务器托管
创建自己的服务器可能是一个非常漫长、繁琐且昂贵的过程。
但通过 BisectHosting,只需点击几下即可获得专属服务器!凭借其全天候支持和快速响应时间,任何问题都不会成为你的阻碍! 感兴趣吗?那我们为你准备了优惠!

你是这个资源的作者?登录后可认领此资源。
相似资源
此数据包添加了属于阿瓦里海盗的独特结构,将他们的独特风格带入你的 Minecraft 世界!兼容性:1.20 至 26.3
一个 Minecraft 光线投射库,能够精确检测玩家正在查看的方块,包括像台阶和楼梯这样的特殊方块形状。
此数据包添加了新的“祝福模式”难度。
允许服务器管理员方便地禁用 Xaero's Map 系列模组中的实体雷达、小地图等功能,使竞技游戏更加公平。
手持潜影盒时可直接打开,无需将其放置在地面上。只需按住 Shift 并右键点击即可访问你的潜影盒。
为你的 Minecraft 世界添加了超过 900 个新的进度
评论 0
登录后参与评分
还没有评论,来抢沙发吧