Enchantments

  • 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!

Status
Not open for further replies.

EnZi

Supporter
Feb 7, 2020
8
1
0
Skript Version: Skript 2.4.1
Minecraft Version: 1.12.2

Hi.. Im trying to create gui where you can combine (item+book || item + item || book + book) (like anvil)..
But after couple of hours of trying I cant figure out how to do it right.. I browsed internet,forums, docs 1000000x times but without anything what can help me with this.. Here are a few options I tried..

Code:

Ex.Nr.1 - In this option its doesnt show up a slot 13.. <-- FIXED ("sharpness" -> "id:16") Thanks to ShaneBee
Code:
        if slot 29 of player's current inventory is enchanted book:
            if slot 33 of player's current inventory is enchanted book:
                set {_item} to (slot 29 of player's current inventory)
                if tag "StoredEnchantments" of nbt of {_item} contains "sharpness":
                    format gui slot 13 of player with enchanted book named "test"

Ex.Nr.2 - This works on 50% but only problem is it remove original enchant from slot 29 and I want to combine it..
Code:
        if slot 29 of player's current inventory is enchanted book:
            if slot 33 of player's current inventory is enchanted book:
                set {_item} to (slot 29 of player's current inventory)
                set {_tag} to (nbt of slot 33 of player's current inventory)
                format gui slot 13 of player with {_item} with nbt {_tag}

Ex.Nr.3 - In this option it show only item from slot 29 in slot 13 without enchant I added at the end..
Code:
        if slot 29 of player's current inventory is enchanted book:
            if slot 33 of player's current inventory is enchanted book:
                set {_item} to (slot 29 of player's current inventory)
                set {_tag} to (nbt of slot 33 of player's current inventory)
                format gui slot 13 of player with {_item}
                enchant (slot 13 of player's current inventory) with {_tag}

Addons using:
skRayFall+v1.9.19
SkQuery-4.1.2
Sk-NBeeT
Skellett
Ersatz
skript-yaml
skript-mirror

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
 
Last edited:
you dont need to use nbt data for enchantments
Code:
if slot 29 of player's current inventory is enchanted with sharpness:
 
you dont need to use nbt data for enchantments
Code:
if slot 29 of player's current inventory is enchanted with sharpness:
Ye, I know but I want to detect which enchant is on book/item :emoji_slight_smile:
 
Status
Not open for further replies.