Solved Renaming a stack according to its amount

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Fladsaw

Member
Jul 18, 2022
30
0
6
Hi everyone! I was wondering if it is possible to rename an item according to its amount. For example, when a player has a stack of diamonds, I want its name to be "64 Diamonds". And when the number is updated, (for example when player drops it) I want its name to be "63 Diamonds" automatically. Is there a way to provide that without stressing the server? Thanks in advance.
 
the only way is looping all the slots of player's inventory each time they pick up an item since you can't check which slot the item went to
 
You could also use the PlayerInventorySlotChangeEvent via reflect or 2.7