Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by TheGamerPlayz, Jun 2, 2016.
What event is called when a command block activates? Also command blocks that don't require redstone
BlockRedstoneEvent. CommandBlocks do not activate unless they are powered by redstone one way or another.
What about repeating CommandBlocks?
1 minutes after reading this, you can use onCommand() to check the CommandBlock, checking if it is a BlockCommandSender
@Banbeucmas what about non-custom commands?
Any way of force opening a a command block?
PS sorry for hijacking
@IceGroose no. When a notchian (default) client clicks on a command block it opens it without sending a packet. Only when it's done doing stuff they send a packet
Haven't test it yet, just check manually right away without checking what command did the sender fires (On theory)
@Banbeucmas the method is only called with commands that are actually registered in your plugin.yml. The ServerCommandEvent might be caled on command blocks, but I don't know
It does not have to send a packet on open, I need it to open a command block when I send a packet
On theory again
Found this on Javadoc
This event is called when a command is run from the server console. It is called early in the command handling process, and modifications in this event (via setCommand(String)) will be shown in the behavior.
You remember that even when the command by CmdBlock is annouced, it still on console right, i think ConsoleSender and BlockCommandSender are different
@IceGroose as I said, there's nothing that can open a command block
Can we use the PlayerInteractEvent and check if the block clicked is a CmdBlock (On theory again ik, i am noob on CmdBlock)
@Banbeucmas they wanted to open a command block window, not check if one is opened
Now i am currently null on what they are trying to accomplish @IceGroose explain clearly?
Ah, in this case @DarkSeraphim already have an answer, you guys might know if it is possible or not
that thread got locked because of the OP's arrogance, they were testing some stuff to make it work on 1.8 but the result has never been posted so I have no clue if he managed to get it working
Edit: this pretty much answers the question. So sad they removed it, it was the coolest way of getting a string value
private Core plugin;
public CommandBlockListener(Core plugin)
this.plugin = plugin;
public void onPlayerChat(PlayerCommandPreprocessEvent e)
Player player = e.getPlayer();
boolean cmbhas = this.plugin.getConfig().getList("command").contains(e.getMessage().replace("/", ""));
if ((!player.hasPermission("cmb.bypass")) &&
player.sendMessage("You are not allowed to use this command!");
Hope this was what your looking for