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.

Solved Get text inside command block?

Discussion in 'Skript' started by egamer3000, Oct 2, 2022.

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

    egamer3000 Member

    Joined:
    Nov 25, 2019
    Messages:
    41
    Likes Received:
    8
    Is there a way to get the commands inside a command block?
    Thanks
     
  2. RoosSkywalker

    RoosSkywalker Member

    Joined:
    Jul 16, 2022
    Messages:
    15
    Likes Received:
    0
    Good question! I am curious about that too. The workaround I would use now is this:

    Create a custom command and give it the
    Code (Text):
    1. executable by: console
    property.
    Then create an event that listens to this custom command and execute your code. Because this custom command can only be executed by console (and thus command blocks), the event should only trigger when that happens.
     
  3. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    with skript-reflect?

    Code (Text):
    1. set {_cmdblock} to block at location ....
    2. set {_state} to {_cmdblock}.getState()
    3. set {_cmd} to {_state}.getCommand()
     
  4. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    Using SkBee

    Code (Text):
    1.  
    2. set {_command to }tag "Command" of nbt compound of target block
    3.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...