HomeJavaModsBlocks To Commands
Blocks To Commands
ModsJava

Blocks To Commands

Vault is a dependency for this plugin! can be found here: An economy plugin that hooks into Vault is also needed. 1.8 binary included for older servers…

⬇ Download on Spigot
Vault is a dependency for this plugin!
can be found here: https://dev.bukkit.org/projects/vault
An economy plugin that hooks into Vault is also needed.

1.8 binary included for older servers

Full documentation here.

The plugin allows the player to assign any command to a block. The command will be run when a player right-clicks the block. The command will be run from the console or from the player depending on how you set it up.

HOW TO USE:
- Look at block
- do /btc create <name>
- next do /btc add cmd <name> <runFromConsole: true/false> <command>
- do /btc help for more info.

- Right-click block (command will run that you set.
Players must have btc.use to be able to right-click the block as well as the custom permission that you may have set.

REMOVE A BLOCK COMMAND:

- crouch and break the block (only possible with perm btc.remove)
===OR===
- /btc remove <name>


Do "/btc list" to see a list of the blocks that have been set

PERMISSIONS:

- btc.admin
- btc.use
- and custom permissions too
Custom: /btc set perm <name> <perm>. e.g /btc set perm test my.perm


Vault Support
- Add Costs to blocks
Commands:
- /btc set cost <name> <amount>
- /btc remove cost <name>

VARIABLES:
Variables are inside a container that looks like this: ${variableName}

- ${name} - gets name of player
- ${displayName} - gets player display name
- ${uuid} - gets UUID of player
- ${ip} - gets player ip
- ${randomPlayer} - gets random name of a player online
- ${x}
- ${y} - X Y Z values of player pos
- ${z}
- ${blockX}
- ${blockY} - X Y Z values of block clicked pos
- ${blockZ}
- ${world} - gets current world name

How to use variables:

/btc add cmd <name> true op ${name}
/btc add msg <name> &aHello ${name}

Variables are case sensitive and must be typed out as shown above!
They use camel casing (first-word first letter lowercase, all following words have an uppercase letter at the beginning of the word)


Spoiler: config.yml
Code (Text):

# ________ _________ ________
# |\ __ \|\___ ___\\ ____\
# \ \ \|\ /\|___ \ \_\ \ \___|
# \ \ __ \ \ \ \ \ \ \
# \ \ \|\ \ \ \ \ \ \ \____
# \ \_______\ \ \__\ \ \_______\
# \|_______| \|__| \|_______|

# BlocksToCommands (V.5.0.0 BETA) 2020
# API: Minecraft 1.8

# By ILoveAMac

# These are the messages non-admin players will receive
# The fundsDeducted and notEnoughFunds message has variables.
# ${cost} -> Value that was deducted from the payer's account.
# ${currency} -> Server currency as set below.
messages:
mayNotPerformCommand: '&cYou do not have permission to perform this command.'
mayNotBreakBlock: '&cYou do not have permission to break this block.'
mayNotUseBlock: '&cYou do not have permission to use this block.'
notEnoughFunds: '&cYou do not have enough ${currency} to use this block.' # e.g You do not have enough dollars to use this block.
fundsDeducted: '&a${cost} ${currency} were deducted from your account.' # e.g 10 dollars were deducted from your account

# Server currency
currency: 'dollars'

# Additional configuration
options:
adminShiftRemove: true # When enabled players with the perm btc.admin ac hold shift and break a BTC block to delete it
interactSounds: true # Play sounds when players interact with BTC blocks # NOT IMPLEMENTED YET
metrics: true # collect anonymous data to help improve plugin?

# Plugin perms
# btc.admin -> Give only to admins on server
# btc.use -> Give to players you want to use BTC blocks
# custom perms can be assigned to blocks too. If a block has a custom perm, a player needs btc.use and the custom set perm in order to use the block
 

Example BTC Block
Spoiler: op.yml
Code (Text):

 
Block:
  name: op
  location:
    world: world
    x: -319
    y: 144
    z: 415
  messages:
    msg_1:
      message: '&aYou are now OP'
  commands:
    cmd_1:
      command: op ${name}
      runFromConsole: true
    cmd_2:
      command: money
      runFromConsole: false
  cost: 1000.0
 

Note:
This plugin makes use of bStats metrics to collect anonymous user data.
If you want to opt-out of data collection you may do so in the config.yml file for my plugin. BTC's bStats page is here.


Thank you for over 5000
downloads!

Have any features suggestions?
Tell me in the discussion section

or fork the project on GitHub
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Blocks To Commands is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 17,636 times (via Spigot). Download it and open it directly in the game.

Explore more