Trying to ban lecterns with NBT tags.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

TheKing1543

Member
Aug 21, 2024
2
0
1
I'm currently trying to patch an exploit related to some plugins in my server, related to a custom lectern with a custom book. I'm trying to make it so lecterns with NBT tags are removed or changed to empty ones. (It's a creative server!) I've tried for hours and I haven't come up with a working solution yet. Any ideas?

Current code:
Code:
on inventory click:
    if clicked item is lectern:
        set {_new_lectern} to a lectern
        set {_new_lectern} to {_new_lectern} without NBT tags
        set clicked item to {_new_lectern}

on inventory open:
    loop all items in player's inventory:
        if loop-item is lectern:
            set {_new_lectern} to a lectern
            set {_new_lectern} to {_new_lectern} without NBT tags
            set loop-item to {_new_lectern}