KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
313 stars 91 forks source link

Tier modification doesn't work #662

Open ChiefArug opened 1 year ago

ChiefArug commented 1 year ago

Minecraft Version

1.19.2

KubeJS Version

56751b429ee50ab05cf6a308f4646a67f5c3e1bb

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

SiverDX commented 1 year ago

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

ChiefArug commented 1 year ago

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.

SiverDX commented 1 year ago

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"?

ChiefArug commented 1 year ago

It means you cannot modify tiers at the moment (as the title of this issue states).

Edit: I clarified the wiki more.

garrett12w commented 5 months ago

Anything going on with this been about a year.

ChiefArug commented 5 months ago

No progress that I know of.

velox-resurrected commented 3 months ago

Added a note for others that end up on this bug report page, this is also broken for 1.20.1 as well.

IlliaSmolin commented 1 month ago

amazing bug fixing speed btw... lasts more than a year