I found it impossible to remove only not enchanted items from the inventory.
command /test:
trigger:
clear player's inventory
give player diamond pickaxe
give player diamond pickaxe of efficiency 1
give player diamond pickaxe of efficiency 2
set {_item} to "diamond pickaxe" parsed as item
remove 3 of {_item} from player's inventory
/test as a playerOnly one pickaxe should be removed from inventory, as the {_item} variable contains the exact item, not itemtype. Instead, all 3 pickaxes are removed.
In this issue I am assuming that diamond pickaxe and diamond pickaxe of efficiency 1 are not the same things when parsed as item - at least that's what I found in the documentation:
Unlike item type an item can only represent exactly one item
I just also found out that this issue appeared in 2.4-beta5 version. In 2.4-beta4 the code above works properly and the issue is not present.
Seems like it's removing an item type rather than an item
I can confirm this as an issue and it can cause huge issues in some cases, hence the high priority.
Personal example: on my server I have a script which allows players to sent items directly to each other (e.g. /itemsend <player> [<amount>] ). I calculate what they're trying to send, store it in a variable, validate that they have it, then remove it from their inventory and add it to a queue for the target player to claim.
Due to this bug, If a player is trying to send a newly crafted diamond pickaxe, it will instead save the plain pickaxe in a variable, give that to the target player (putting it in their queue), and remove the first diamond pickaxe it finds in the user's inventory instead of the correct one that they're holding. Often that will end up being their main pick over in one of their first couple of slots, which ends up being straight up deleted as a result.
I had to update multiple scripts to use skript-mirror to remove the item from the player's inventory instead of using Skript's remove effect.
I hope my quick fix doesn't break anything else.
@bensku How reassuring! :sweat_smile:
I'm sure it's fine.
It was fixed in beta6 but appeared again in beta7. #2404
Most helpful comment
I can confirm this as an issue and it can cause huge issues in some cases, hence the high priority.
Personal example: on my server I have a script which allows players to sent items directly to each other (e.g.
/itemsend <player> [<amount>]). I calculate what they're trying to send, store it in a variable, validate that they have it, then remove it from their inventory and add it to a queue for the target player to claim.Due to this bug, If a player is trying to send a newly crafted diamond pickaxe, it will instead save the plain pickaxe in a variable, give that to the target player (putting it in their queue), and remove the first diamond pickaxe it finds in the user's inventory instead of the correct one that they're holding. Often that will end up being their main pick over in one of their first couple of slots, which ends up being straight up deleted as a result.
I had to update multiple scripts to use skript-mirror to remove the item from the player's inventory instead of using Skript's
removeeffect.