Solved changing text in a command block

Discussion in 'Plugin Development' started by davidovski, Aug 24, 2017.

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

    davidovski

    I have been trying to make a plugin lately that involves various machines in forms of command blocks. However this in unrealted as i still can't change the text in the command blocks so it can save the machine's state, speed, upgrades, and type. here is the "basic" code on what i'm trying to do.
    Code:
    Block block = p.getLocation().getBlock();
    block.setType(Material.COMMAND);
    CommandBlock state = (CommandBlock) block.getState();
    state.setCommand("test");
    Is there something i'm missing, like setting the blocks state to the command block one, or something...

    i URGENTLY need this because everyone on my server is expecting this to be done by tomorrow. So i kinda need this quite a lot, and i thank anyone that can help me.
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    davidovski

    thank you. :D
     
Thread Status:
Not open for further replies.

Share This Page