Since the beginning of command blocks, people have wanted to right click while holding blocks/swords/item for an effect to happen. But they can’t. It would be great to have a plugin that turns sponge’s InteractBlockEvent.Secondary into an event that can be used in command blocks.
I guess you want to trigger a command block and thus executing a command.
I am not aware of any tricks that could achieve this with vanilla scoreboard and command blocks magic.
Though I can recommend you to look into Kt-Skript.
Something like
onBlockRightClick {
if (causedByPlayer && clickedInAir && causingPlayer.hasItemInHand()) {
val heldItemStack = causingPlayer.getItemInHand()
if (heldItemStack.type == ItemTypes.FEATHER) {
Server.console.executeCommand("say Right clicked in air with feather")
}
}
}
could work for you.