1. 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 comminuty!

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


    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to give items that can only break certain blocks

Discussion in 'Skript' started by Pexien, Apr 20, 2018.

Thread Status:
Not open for further replies.
  1. Pexien

    Pexien New Member

    Aug 10, 2017
    Likes Received:
    I am coding a adventure script for my server, and I want to give the player's a diamond pickaxe that can only destroy sponge. How do you add the canDestroy tag in skript? Ir would also be good if I could give players sponge blocks that could only be placed on certain blocks in skript. Is there any way to do this without having console have to execute the command?
  2. ShaneBee

    Supporter + Addon Developer

    Sep 7, 2017
    Likes Received:
    So.... I don't know much about NBT, but you could write a simple skript like this
    Code (Skript):
    1. on break:
    2.     if player's tool is a diamond pickaxe:
    3.         if lore of player's tool contains "your lore here":
    4.             if event-block is not sponge:
    5.                 cancel event
    6.                 send "some message about not being able to break blocks"
    I suggest using LORE because a player can easily change the name of a tool in game and mess up this system

    As for the placing, very similar
    Code (Skript):
    1. on place of sponge:
    2.     if lore of player's tool contains "lore of your sponge here":
    3.         if targeted block is not (whatever block you want the sponge to be placed on):
    4.             cancel event
    5.             send "some message about not being able to place sponges here"
    I dont think this is really the BEST answer.... but this will give you some insight on some simple solution to fix this issue
  3. DieHollander_

    DieHollander_ Active Member

    Mar 25, 2018
    Likes Received:
    Do you mean when a player is in adventure mode?
    If you mean that you can use this:
    Code (Skript):
    1. add "{CanDestroy:["diamond_ore"]}" to nbt of player's tool
    It requires SkStuff.
    ShaneBee likes this.
Thread Status:
Not open for further replies.

Share This Page