Reading and Opening Commandblocks

Discussion in 'Spigot Plugin Development' started by DaanSander, May 15, 2015.

  1. Hello is there a way to open commandblocks and read whats typed in the command line if so how can i do this?

    sorry for bad english
     
  2. You can no longer force open the command block GUI as of 1.8. However, you can still get the input from the custom payload packet with tag MC|AdvCmd.
     
  3. I advise you do take a sign. It can be opened to a player and you can read the input.
     
  4. Alternative, somewhat full answer (excerpts from my Consoles project):

    https://gist.github.com/wacossusca34/36a82d097f7fb9c926c8

    No packet handling here, instead I go right after the command block's tile entity in NMS code - this way we can effectively listen for commands the same way the server does (via redstone, etc), set the output, or just read input when it's changed. You can also add custom vanilla commands with this, which allow for commands built specifically for command blocks.

    Admittedly this is insanely complex in comparison to just listening for a packet, but you actually get to access the data (and methods) that the command block holds instead of just grabbing info from packets.

    You cannot open a command block GUI for a client, though, like DarkSeraphim pointed out.