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 (beta8) :( #2489

Closed rudde0 closed 3 years ago

rudde0 commented 4 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 and beta-8.

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, Skript 2.4 beta-5 and Skript 2.4 beta-8.

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 Remove effect in Skript 2.4 beta-8 (same result with beta-5): https://i.imgur.com/4WVktLC.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
Wealthyturtle commented 4 years ago

From what you're saying, it looks like https://github.com/SkriptLang/Skript/commit/062a7236d4b988a2fc79d8cfe9707f247d507cfa broke something...

Cleaning up your script for others to take a crack at this issue

command /giveitem <string>:
    trigger:
        set {_i} to dirt
        set nbt of {_i} to arg-1

command /nbttest <string>:
    trigger:
        removeNBTItem(player, 1, arg-1)

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
bensku commented 4 years ago

Can someone provide a test case without NBT?

Alderheart commented 4 years ago

I can. When the player dies, nether quartz drops anyways. I can also confirm it was working but recently broke.

on death:
    remove all nether quartz from drops
legofreak1999 commented 4 years ago

The whole remove effect with items seems to be broken. Still with beta9.

command /remove:
    trigger:
        remove all paper from player
TPGamesNL commented 3 years ago

Cannot reproduce, this has probably been fixed