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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    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.

Can't figure out how to make command

Discussion in 'Skript' started by mynameisgeofferyjkjk, Feb 5, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. mynameisgeofferyjkjk

    Joined:
    Jan 9, 2022
    Messages:
    7
    Likes Received:
    0
    I have the first part, I just can't figure where to start with this. I'm trying to make a command that creates a new custom mineable block. We have it hardcoded currently, but a command would save a LOT of space.

    This is the code I have now:
    Code (Text):
    1. command /newblock [<Block>} [<Name>] [<Lore>] [<Lore2]:
    2.     permission: sk.staff
    3.     triggers:
    4.     if arg-1 is block:
    This is the code we have hardcoded in currently.
    Code (Text):
    1. if event-block is oak wood:
    2.                 if event-player is not holding barrier:
    3.                     cancel event
    4.                     set {_itemcount} to random integer between 1 and 3
    5.                     give {_itemcount} of oak planks named "&6Oak Planks" to event-player
    6.                     set event-block to bedrock
    7.                     wait 1.5 seconds
    8.                     set event-block to oak wood
    We have more, but this is the general idea.
    --- Double Post Merged, Feb 5, 2022, Original Post Date: Feb 5, 2022 ---
    Mistype in the code on my part lol

    Code (Text):
    1.  
    2. if event-block is oak wood:
    3.             if event-player is not holding barrier:
    4.                 cancel event
    5.                 set {_itemcount} to random integer between 1 and 3
    6.                 give {_itemcount} of oak planks named "&6Oak Planks" to event-player
    7.                 set event-block to bedrock
    8.                 wait 1.5 seconds
    9.                 set event-block to oak wood
    10.  
     
  2. Eszi

    Eszi Member

    Joined:
    Sep 19, 2021
    Messages:
    14
    Likes Received:
    0
    I think what you mean is when you mine a block it should turn into bedrock, wait 1.5 seconds and then turn back to the original block + giving you the drops directly. If that is what you want then here is your code:

    Code (Text):
    1. command addcustomblock <itemtype>:
    2.     trigger:
    3.         add arg-1 to {customblocks::*}
    4.         set {_} to "%arg-1%"
    5.         send "&aSuccessfully added %{_} in strict proper case%&a to the custom block list!"
    6.        
    7. on break:
    8.     if {customblocks::*} contains event-block's type:
    9.         cancel event
    10.         set {_} to event-block's type
    11.         give (random integer between 1 and 3) of event-block named "&6%{_} in strict proper case%" to player
    12.         set event-block to bedrock
    13.         wait 1.5 seconds
    14.         set event-block to {_}
    I'm sorry if this is not exactly what you wanted, but "custom mineable block" isn't going to do it for me.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...