? LG 的命令物品数据包
此数据包提供了一种在触发特定事件时直接向物品添加命令的方法。事件堆叠意味着你可以同时为“右键点击”和“攻击生物”或“被攻击”等场景设置不同的命令!
使用教程
使用 /function a:open_menu 命令,然后点击 Add Commands(添加命令)按钮,选择输入类型和槽位,最后通过红色的“Confirm”(确认)按钮进行确认。这会将命令添加到你所选的输入类型与槽位的组合中。
当前触发条件与槽位
触发条件
- Tick(每秒 20 次)
- Use Item(右键点击时触发,要求物品必须是可消耗的;Item Modifier 可以方便地将物品变为可消耗品,请参阅相关命令)
- Using Item(在使用物品期间持续触发)
- Player Hurt Entity(每当玩家攻击实体时触发)
- Player Killed Entity(每当玩家击杀实体时触发)
- Entity Hurt Player(每当玩家受到伤害时触发)
- Inventory Changed(每当玩家的背包发生变化时触发)
槽位
- Mainhand(主手)
- Offhand(副手)
- Head(头部)
- Chest(胸部)
- Legs(腿部)
- Feet(脚部)
限制说明
每个触发条件 + 槽位的组合只能放置一个命令。如需执行多个命令,建议使用函数。
对于 Tick 类型的触发条件,出于优化考虑,建议不要使用冷却时间。如果不这样做,虽然不会导致服务器卡顿,但当多名玩家同时使用时,可能会对性能产生负面影响。
其他附加功能
- Cooldowns(冷却时间)—— 你可以轻松地为命令添加冷却时间,它们不会生成记分板,而是直接绑定到物品上。
- Swap Hand Items(交换手中物品)—— 简单地交换主手和副手的物品。
- Show Cooldown(显示冷却时间)—— 当处于冷却状态时,会在聊天栏中显示剩余冷却时间。不建议在 Tick 触发条件中使用,以免刷屏。
- Consume On Trigger(触发时消耗)—— 一旦触发,将消耗 1 个被使用的物品。
⚠️ 重要命令!
/function a:open_menu
/function a:copy_item
/function ci:reset_cds
? YouTube 展示视频
🔀 LG's Command Items datapack
This datapack adds a way to add commands directly to items when triggering a specific event, events stacks meaning you can have a command for Right-Click as well as a command when attacking a mob or getting attacked!
Usage Tutorial
Use /function a:open_menu command, then click Add Commands button, select your input and slot, then confirm with the red "Confirm" button, it will add the command to your selected input + slot combination
Current Triggers & Slots
Triggers
- Tick (20 times per second)
- Use Item (on right-click, requires the item to be consumable, the Item Modifier makes it easy to turn an item into consumable, check commands)
- Using Item (Triggers whenever you're using the item)
- Player Hurt Entity (whenever player attacks an entity)
- Player Killed Entity (whenever player kills an entity)
- Entity Hurt Player (whenever the player gets damaged)
- Inventory Changed (whenever players' inventory changes)
Slots
- Mainhand
- Offhand
- Head
- Chest
- Legs
- Feet
Limitations
You can only put one command into each trigger + slot combo, to use several commands, it is recommended to use functions
For any ticking trigger, I recommend not using cooldowns simply for optimization purposes, it won't fry your ticks if you don't do so, but with several players using those, it may very likely affect your performance negatively
Other Additions
- Cooldowns - You can easily add cooldowns to your commands, they generate no scoreboards and are bound directly to items
- Swap Hand Items - Simply swaps your mainhand and offhand items
- Show Cooldown - When on cooldown, displays the cooldown on the chat, not recommended to use on ticking triggers so not to flood your chat
- Consume On Trigger - Once triggered, consumes 1 of the used items
⚠️ Important commands!
/function a:open_menu
/function a:copy_item
/function ci:reset_cds
🔴 YouTube Showcase
评论 0
登录后参与评分
还没有评论,来抢沙发吧