CommandBlock Redstone Output

Discussion in 'Plugin Development' started by hellboyPS, Oct 8, 2014.

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

    hellboyPS

    Hey guys,

    I'm having quite a bit of trouble trying to set the (redstone) output of a commandblock (to a comparator).
    I know the output of a commandblock seems to be buggy on bukkit servers anyway (always generates an output, even if the command fails), but that's not the point.
    I want to be able to control the output, so that I can set it to on and off whenever I like.

    I've tried the following code, sadly without success:
    Code:
     
    public void setPowered(CommandBlock state, boolean power) {
            Command c = (Command) state.getData();
            c.setPowered(power);
            state.setData(c);
            state.update(true, true);
        }
    I am able to turn the commandblock "off" by just setting it to stone and then back to a commandblock. Thats not a nice solution, but it works. However, i have not discovered any way to power a commandblock which produces no output yet.
    I have also tried to execute a command and then catching it with onCommand and returning true/false, however, this has no impact at all.
    Maybe it is possible to turn it on by just making the commandblock execute a (dummy) command?
    That would be all I need, i guess.

    Does anyone know a nice way to achieve this?

    Thanks,
    hellboyPS
     
  2. Offline

    hellboyPS

    Hi. Im just gonna /push this one. Thanks in advance.
     
Thread Status:
Not open for further replies.

Share This Page