SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 368 forks source link

Remove effect don't work properly #2404

Closed rudde0 closed 5 years ago

rudde0 commented 5 years ago

Description

I've set my hotbar 0, 1 and 2 with two papers with nbt CustomItems:Summon_Skeleton_1/2/3 and I tried to remove them with function below. I attached two result belongs to Skript 2.3.7 and Skript 2.4-beta-5

Expected Behavior

Remove just one in each hotbar. So Skript 2.3.7 works properly in that case.

Errors / Screenshots

No errors in console. Remove effect in Skript 2.4-beta-5: https://i.imgur.com/P0s2DD2.png Remove effect in Skript 2.3.7: https://i.imgur.com/9qGhq9c.png

Server Information

command /nbttest:
    trigger:
        removeNBTItem(player, 1, "CustomItems:""Summon_Skeleton_1""")
        removeNBTItem(player, 1, "CustomItems:""Summon_Skeleton_2""")
        removeNBTItem(player, 1, "CustomItems:""Summon_Skeleton_3""")
function removeNBTItem(p: player, a: number, nbt: text):
    broadcast " ", " "
    broadcast "&bSearching: %{_nbt}%"
    loop all items in {_p}'s inventory:
        broadcast " "
        nbt of loop-item contains {_nbt}
        broadcast "&cRemoved: %loop-item%(%{_a}%)"
        remove {_a} of loop-item from {_p}
        stop loop
TheBentoBox commented 5 years ago

This is a duplicate of #2354 as it is caused by the same bug.