Can't figure out how to make command

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

  • 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.
Jan 9, 2022
8
0
1
23
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:
command /newblock [<Block>} [<Name>] [<Lore>] [<Lore2]:
    permission: sk.staff
    triggers:
    if arg-1 is block:

This is the code we have hardcoded in currently.
Code:
if event-block is oak wood:
                if event-player is not holding barrier:
                    cancel event
                    set {_itemcount} to random integer between 1 and 3
                    give {_itemcount} of oak planks named "&6Oak Planks" to event-player
                    set event-block to bedrock
                    wait 1.5 seconds
                    set event-block to oak wood
We have more, but this is the general idea.
[doublepost=1644070117,1644070080][/doublepost]Mistype in the code on my part lol

Code:
if event-block is oak wood:
            if event-player is not holding barrier:
                cancel event
                set {_itemcount} to random integer between 1 and 3
                give {_itemcount} of oak planks named "&6Oak Planks" to event-player
                set event-block to bedrock
                wait 1.5 seconds
                set event-block to oak wood
 
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:
command addcustomblock <itemtype>:
    trigger:
        add arg-1 to {customblocks::*}
        set {_} to "%arg-1%"
        send "&aSuccessfully added %{_} in strict proper case%&a to the custom block list!"
        
on break:
    if {customblocks::*} contains event-block's type:
        cancel event
        set {_} to event-block's type
        give (random integer between 1 and 3) of event-block named "&6%{_} in strict proper case%" to player
        set event-block to bedrock
        wait 1.5 seconds
        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.
 
Status
Not open for further replies.