Shadows-of-Fire / Apotheosis

All things that should have been.
Other
155 stars 120 forks source link

Stackable items can't be enchanted #1178

Closed RedBlockCreator closed 4 months ago

RedBlockCreator commented 4 months ago

What the title says.

I have tested this by making items stackable with bigger stacks and kubejs, both do not allow items to be enchanted.

image

Shadows-of-Fire commented 4 months ago

This issue will present in vanilla as well and is not something I am willing to change (due to potential introduction of side effects).

The vanilla code for Item#isEnchantable is

   public boolean isEnchantable(ItemStack pStack) {
      return this.getMaxStackSize(pStack) == 1 && this.isDamageable(pStack);
   }

which means changing the stack size will make the items non-enchantable.