Closed MichealAPI closed 1 year ago
I assume you use Player#getItemInHand or some other variance of it. What that does, is it gives you a reference to the actual item which is still held in the hand, so whenever it's added to another inventory, it's still the same ItemStack. To prevent that you can create a completely new ItemStack with just the properties of the one in the player's hand.
ItemStack#clone worked as expected. Solved
I'm currently creating a plugin that allows players to sell items to a shop. During testing, I noticed that if a player sells a "Pickaxe" (or any other item defined in the configuration using the "getShopItems" method) and then picks up an identical pickaxe, both items will have their display name and lore changed to match the shop's configuration.