Sueta

BlockCommands

1.1.2

Run console commands when a player clicks certain blocks!

·Plugin


Introduction:
BlockCommands is a plugin which allows you to setup Blocks which will run console commands when a player interacts with them.

You can run commands on Left-Click, Right-Click, Shift-Left-Click and Shift-Right-Click.
COMMANDS ARE NOT BOUND BY BLOCK, THEY ARE BOUND BY BLOCK TYPE. (This means, all blocks of the configured type will function the same. )

Configuration:
The default configuration is using FURNACES and CRAFTING TABLES to run MMOItems crafting station command. That makes :

#When this is set to true, placing a block will override
#the command and allow block placement.
placement_check: true

#'Right_Click:' is the event which will need to be triggered for the command to run.
#In this case it happens if the player right-clicks desired block WITHOUT sneaking.
Right_Click:
  FURNACE: "mi stations open arcane-forge {player}"
Left_Click:
  CRAFTING_TABLE: "mi stations open steel-crafting-station {player}"
  ACACIA_PLANKS: "tp {player} {blockx} {blocky} {blockz}"
#{player} will be replaced by the name of the player
#{blockx} will be replaced by the X position of the block
#For more placeholders, check the wiki
Shift_Right_Click:
  OAK_PLANKS: "say oak planks clicked!"
#Shift_Left_Click:
#  COBBLESTONE: "cobblecommand"
#If you do not wish to add anything on Shift Left Click, then delete it entirely from the config.

In this case, Furnaces will be entirely overwritten and will instead open the MMOItems arcane-forge for the player who clicked it. Hitting a Crafting Table will open the steel-crafting-station and hitting Acacia Planks will teleport the player into them.

If you do not wish to add any commands under a subcategory (example: "Shift_Left_Click"),
remove the section completely from the configuration.

(Update 1.1 or later)
You can also input "MMOITEMS_*customblockid*" instead of a material to add commands only to custom blocks added by MMOItems.

Tags:
BlockCommands supports various tags to replace for variables.

{player}: Playername
{playerx}: Player X Coord
{playery}: Player Y Coord
{playerz}: Player Z Coord
{blockx}: Block X Coord
{blocky}: Block Y Coord
{blockz}: Block Z Coord

BlockCommands also supports PAPI placeholders if PAPI is installed.

Configuration Examples:

Right_Click:
  CRAFTING_TABLE: "mi stations open steel-crafting-station {player}"

This configuration will result in this happening:
(Crafting Stations are provided by MMOItems)

My Other Plugins
MythicMobs Discord

Similar projects

Plugin →