Skill Slots 是一个模组,它为基于物品的技能添加了玩家技能槽。你可以使用 KubeJS 或 Java 代码来创建自己的技能。
// priority: 0
// Server script
// 使你的物品可以放入技能槽中
// 如果物品已经具有右键功能,那么该技能现在即可生效
ServerEvents.tags('item', event => {
event.add('skillslots:skill', 'minecraft:diamond')
})
// 当然,你也可以使用 KubeJS 创建一个物品,并为其添加一些炫酷的右键功能
ItemEvents.rightClicked('minecraft:diamond', event => {
event.player.tell('你右键点击了钻石!')
// 冷却时间,有效
event.player.addItemCooldown(event.item, 60)
})
// 当使用技能时也会触发此事件
BlockEvents.rightClicked(event => {
// 自行检查物品冷却时间
event.player.tell('你右键点击了一个方块!')
})
// 在这里你将了解如何从玩家处获取对技能槽的访问权限
ItemEvents.rightClicked('minecraft:emerald', event => {
let handler = Java.loadClass('snownee.skillslots.SkillSlotsHandler').of(event.player)
let diamond = Item.of('minecraft:diamond')
// 以下是一些自定义技能的 NBT 选项
diamond.nbt = {}
diamond.nbt.SkillSlots = {
UseDuration: 20,
IconScale: 1.5,
// CanBeToggled: true, // 使你的技能作为被动技能工作。玩家可以开启/关闭它
ChargeCompleteSound: 'minecraft:entity.player.levelup', // 留空以静音
}
// 在配置中,你可以禁用玩家更改技能的能力
// 这里有一个通过 KubeJS 更改技能的示例
handler.setItem(0, diamond)
// 检查玩家是否拥有可切换且当前激活的技能的示例
let index = handler.findActivatedPassiveSkill(skill => skill.item.id === 'minecraft:diamond')
if (index !== -1) {
let skill = handler.skills.get(index)
event.player.tell(skill.item.id)
}
})
你可以使用 handler.setSlots(int) 来设置解锁槽位的数量,或者使用本模组提供的“槽位解锁”物品。
只有安装了 JEI 时才会显示彩色按钮边框。
Skill Slots is a mod that adds player skill slots for item-based skills. You can use KubeJS or Java code to create your own skills.
// priority: 0
// Server script
// Make your item can be put in skill slots
// If the item already has a right-click function, the skill already works now
ServerEvents.tags('item', event => {
event.add('skillslots:skill', 'minecraft:diamond')
})
// Of course, you can use KubeJS to create an item, and add some fancy right-click function to it
ItemEvents.rightClicked('minecraft:diamond', event => {
event.player.tell('You right clicked a diamond!')
// Cooldown, works
event.player.addItemCooldown(event.item, 60)
})
// This event will also be called when using the skill
BlockEvents.rightClicked(event => {
// Check the item cooldown by yourself
event.player.tell('You right clicked a block!')
})
// Here you will know how to get access to the skill slots from a player
ItemEvents.rightClicked('minecraft:emerald', event => {
let handler = Java.loadClass('snownee.skillslots.SkillSlotsHandler').of(event.player)
let diamond = Item.of('minecraft:diamond')
// Here are some NBT options to customize the skill
diamond.nbt = {}
diamond.nbt.SkillSlots = {
UseDuration: 20,
IconScale: 1.5,
// CanBeToggled: true, // make your skill work as a passive skill. the player can toggle it on/off
ChargeCompleteSound: 'minecraft:entity.player.levelup', // leave it empty to mute
}
// In config, you can disable the player ability to change skills
// Here is an example to change the skill through KubeJS
handler.setItem(0, diamond)
// Example of checking if the player has a skill that can be toggled and currently activated
let index = handler.findActivatedPassiveSkill(skill => skill.item.id === 'minecraft:diamond')
if (index !== -1) {
let skill = handler.skills.get(index)
event.player.tell(skill.item.id)
}
})
You can use handler.setSlots(int) to set the amount of the unlocked slots, or use the Slot Unlock item provided by this mod.
The colored button border is provided only when JEI is installed.
下载 Skill Slots
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Skill Slots
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Skill Slots
下载 Skill Slots
下载 Skill Slots
下载 Skill Slots
下载 Skill Slots
下载 Skill Slots
下载 Skill Slots
下载 Skill Slots
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
可定制的鞘翅模组,支持装饰纹饰、旗帜图案等更多功能!
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。

评论 0
登录后参与评分
还没有评论,来抢沙发吧