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 (beta7) #2446

Closed rudde0 closed 4 years ago

rudde0 commented 5 years ago

I've opened a ticket which related with this issue like 2 weeks ago. It was in Skript beta-5 and has been fixed in Skript beta-6 but the same issue appeared again Skript beta-7.

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

I'll use this as the new main issue for tracking this problem as it seems to describe it best. Though ideally the example wouldn't rely on an add-on.

This is a really bad bug that needs fixing. It's as bad as the other critical bugs that have been fixed recently.

bensku commented 5 years ago

Regression was introduced in 062a72. Unfortunately, that commit fixes another high-priority bug. Changing ItemData equals() MatchQuality to EXACT might help, but is dangerous in other ways.

rudde0 commented 5 years ago

Thanks for the information. What should I do for temporary solution?

iOshawott commented 5 years ago

You are talking about some bugs in beta-5 which is in beta-7... I don't understand, bug I saw is only in beta-7, not in beta-5. (#2442) [I see it's similar bug but I don't have it on beta-5 but only on beta-7 xd]Hope it will be fixed too

I will be staying in beta-5 for now