I've made a plugin in Spigot 1.8 that lets you remotely trigger a button with /fire. The plugin works and powers redstone around it, but doesn't power the block it's attached to. How do I fix this? When I press the button with hand: When I trigger the button with /fire: I power the button with: Code (Java): Block b = Main.buttons.get(player); // gets button location from hashmap b.setData((byte) (b.getData() | 0x8)); then after 1 second the button is reset.
You should be using API methods when possible. Try something like: Code (Java): Button button = (Button) block.getState().getData(); button.setPowered(true);
I've tried this before and nothing happens when I type the command. Code (Text): Block b = Main.buttons.get(player); Button button = (Button) b.getState().getData(); button.setPowered(true);
This should work. Plottwist. 1.13+ code. Code (Text): Block b = Main.buttons.get(player); BlockState state = b.getState(); Powerable button = (Powerable) state.getBlockData(); button.setPowered(true); state.setBlockData(button); state.update();