关于如何创建自定义附魔并且可以为附魔创建出附魔效果
我最开始思路是 通过lore 然后判断lore的存在 在监听事件中生效
但是发现可以直接创建附魔 请问如何创建一个自定义附魔 名称自定
我最开始思路是 通过lore 然后判断lore的存在 在监听事件中生效
但是发现可以直接创建附魔 请问如何创建一个自定义附魔 名称自定
?????
请告知游戏版本和API类型
请告知游戏版本和API类型
洞穴夜莺 发表于 2021-9-19 15:43
?????
请告知游戏版本和API类型
1.16.5的spigot 用的1.17的javadoc
本帖最后由 结冰的离季 于 2021-9-19 21:33 编辑
首先,写个自定义类继承抽象类Enchantment并实现相应的方法
然后修改Enchantment类里的 private static boolean修饰的acceptingNew对象为true(反射)
然后调用Enchantment.registerEnchantment()方法注册你的自定义附魔,
最后调用Enchantment.stopAcceptingRegistrations()停止注册
完事
需要注意的是自定义的附魔正常来说无法显示(只能借助lore)
但是如果你像Ecoenchant一样重写整个附魔系统另说
我说的很笼统,具体你可以找找教程,或者翻我代码(kt写的,而且写的很拉)
给几个教程吧
Custom Enchantments. You say what?! | Bukkit Forums
Solved - Custom Enchantments | Bukkit Forums
1.16.5 - Adding custom enchants to the enchanting table | SpigotMC - High Performance Minecraft
How to make a Spigot 1.15+ plugin (Ep17) Custom Enchants - YouTube
首先,写个自定义类继承抽象类Enchantment并实现相应的方法
然后修改Enchantment类里的 private static boolean修饰的acceptingNew对象为true(反射)
然后调用Enchantment.registerEnchantment()方法注册你的自定义附魔,
最后调用Enchantment.stopAcceptingRegistrations()停止注册
完事
需要注意的是自定义的附魔正常来说无法显示(只能借助lore)
但是如果你像Ecoenchant一样重写整个附魔系统另说
我说的很笼统,具体你可以找找教程,或者翻我代码(kt写的,而且写的很拉)
给几个教程吧
Custom Enchantments. You say what?! | Bukkit Forums
Solved - Custom Enchantments | Bukkit Forums
1.16.5 - Adding custom enchants to the enchanting table | SpigotMC - High Performance Minecraft
How to make a Spigot 1.15+ plugin (Ep17) Custom Enchants - YouTube