I'm working on a way to override the floor function on anvil enchantment combination: if a item has a enchantment greater than the max when combining it, the level will remain instead of being reset to the max level.
I think the code cannot recogize enchantments properly inside variables does anyone know a work-around?
Code:
on inventory open:
wait 1 tick #required to get correct inventory check
if type of event-inventory is anvil inventory:
while type of player's current inventory is anvil inventory:
wait 1 tick
if item in slot 2 of player's current inventory is set:
loop slot 2 of player's current inventory's enchantments:
set {_L} to "%enchantment level of loop-value%" #gets level of enchantment
set {_enchantment} to "%loop-value%"
replace {_L} with "" in {_enchantment} #removes level of enchantment
replace " " with "" in {_enchantment}
set {_enchantment} to {_enchantment} parsed as enchantment type
set {_S1} to item in slot 1 of player's current inventory
set {_L1} to level of {_enchantment} of {_S1} #always gets set to null. doesn't recognize variables as enchantment