Tier modification doesn't work
ChiefArug opened this issue ยท 8 comments
Minecraft Version
1.19.2
KubeJS Version
Rhino Version
rhino-forge-1902.2.2-build.268.jar
Architectury Version
6.5.82
Forge/Fabric Version
43.2.11
Describe your issue
This script doesn't work.
The first one is visible in tooltip and when testing against mobs. Confirmed the second one through a debugger, stack.getItem().getEnchantmentValue()
returns 14, the default.
However, for both of them, they cannot be repaired at all. Even the wooden sword. Removing the tier part of the modification fixes that.
ItemEvents.modification(event => {
event.modify('golden_sword', item => {
item.tier = tier => {
tier.speed = 12
tier.attackDamageBonus = 10
tier.repairIngredient = '#forge:storage_blocks/gold'
tier.level = 3
}
})
event.modify('wooden_sword', item => {
item.tier = tier => {
tier.enchantmentValue = 30
}
})
})
Crash report/logs
No response
Removing the tier part of the modification fixes that.
what does that mean? how would i have to change the script to make it work?
item.tier.tierOptions.repairIngredient
or item.tier.repairIngredient
or item.repairIngredient
(i.e. not doing = tier =>
) do not work and crash the game
item.setTier(tierOptions => {
tierOptions.repairIngredient = ...
}
also doesn't work
item.tier.setRepairIngredient
does not exist
what does that mean?
The thing I was talking about with that line was that trying to modify the tier of anything resulted in the repair ingredient of that tier not working anymore, even if I did not try to modify the repair ingredient.
how would i have to change the script to make it work?
You can't. The entire point of this issue is that it doesn't work.
item.tier.setRepairIngredient
does not exist
It only exists on KubeJS' MutableToolTier
class, it doesn't exist by default on other Tier implementations.
But what does
Kinda broken at the moment! https://github.com/KubeJS-Mods/KubeJS/issues/662. Use the non tier methods instead.
mean then? Does it just mean "you cannot modify anything regarding tiers at the moment" or does it mean "you can use some? method of the item itself to modify tiers"?
It means you cannot modify tiers at the moment (as the title of this issue states).
Edit: I clarified the wiki more.
Added a note for others that end up on this bug report page, this is also broken for 1.20.1 as well.