#enchant tube

5 messages · Page 1 of 1 (latest)

meager spindle
#

I do not know how to write code for an item that can track the player's experience and display it on the item, as a watch or compass does. Please help me

dense frigateBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

light herald
#

https://github.com/AlmostReliable/morejs/wiki/Xp-Change

  • use xp change event:
  • find if item is in inventory
const slot = event.player.inventory.find('item id');
if(slot == -1) return;
const item = event.player.getItemBySlot(slot);
  • get xp percentage(now xp / max xp)
event.experienceLevel / 100
  • remove the old item
item.shrink(1)
  • give new item in slot
event.player.setItemSlot(slot, 'new item id')

it requires creating multiple items