Blocks To Commands v5.0.0-beta.6

Allows player to assign a command to any block in-game | Make any block run a command!

  1. ILoveAMac
    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)


    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
    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
    Coen, joda, MindoTv and 1 other person like this.

Recent Reviews

  1. BrianSils12
    BrianSils12
    5/5,
    Version: v5.0.0-beta.6
    1.12.2 Spigot (catserver)

    [00:01:54] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to Blocks_To_Commands vv5.0.0-beta.6
    org.bukkit.event.EventException: null
    at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:69) ~[EventExecutor$2.class:git-CatServer-1.12.2-35187d3]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[RegisteredListener.class:git-CatServer-1.12.2-35187d3]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:503) [SimplePluginManager.class:git-CatServer-1.12.2-35187d3]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:488) [SimplePluginManager.class:git-CatServer-1.12.2-35187d3]
    at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:274) [CraftEventFactory.class:git-CatServer-1.12.2-35187d3]
    at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:241) [CraftEventFactory.class:git-CatServer-1.12.2-35187d3]
    at net.minecraft.block.BlockPressurePlate.func_180669_e(BlockPressurePlate.java:92) [asw.class:?]
    at net.minecraft.block.BlockBasePressurePlate.func_180666_a(BlockBasePressurePlate.java:125) [aor.class:?]
    at net.minecraft.block.BlockBasePressurePlate.func_180634_a(BlockBasePressurePlate.java:118) [aor.class:?]
    at net.minecraft.entity.Entity.func_145775_I(Entity.java:1251) [vg.class:?]
    at net.minecraft.entity.Entity.doBlockCollisionsCB(Entity.java:1228) [vg.class:?]
    at net.minecraft.entity.Entity.func_70091_d(Entity.java:741) [vg.class:?]
    at net.minecraft.entity.EntityLivingBase.func_191986_a(EntityLivingBase.java:2289) [vp.class:?]
    at net.minecraft.entity.player.EntityPlayer.func_191986_a(EntityPlayer.java:1984) [aed.class:?]
    at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2730) [vp.class:?]
    at net.minecraft.entity.player.EntityPlayer.func_70636_d(EntityPlayer.java:529) [aed.class:?]
    at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2512) [vp.class:?]
    at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:249) [aed.class:?]
    at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:468) [oq.class:?]
    at net.minecraft.network.NetHandlerPlayServer.func_73660_a(NetHandlerPlayServer.java:250) [pa.class:?]
    at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:209) [NetworkDispatcher$1.class:git-CatServer-1.12.2-35187d3]
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:235) [gw.class:?]
    at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:187) [oz.class:?]
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:1010) [MinecraftServer.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:475) [nz.class:?]
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:834) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]
    Caused by: java.lang.NullPointerException
  2. bladeRR1
    bladeRR1
    5/5,
    Version: v5.0.0-beta.6
    1.17 please :)

    [08:39:17 ERROR]: Could not pass event PlayerInteractEvent to Blocks_To_Commands vv5.0.0-beta.6
    java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.EquipmentSlot.equals(Object)" because "e" is null
    at me.ILoveAMac.BTC.listeners.PlayerInteract.onClick(PlayerInteract.java:37) ~[BlocksToCommands_1.9-1.15.2-v5.0.0-beta.6.jar:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor200.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Purpur-1390]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:542) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:505) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:500) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.level.block.BlockRedstoneOre.stepOn(BlockRedstoneOre.java:49) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.Entity.move(Entity.java:1038) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.a(EntityLiving.java:2858) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.g(EntityLiving.java:2813) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.g(EntityHuman.java:1640) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.movementTick(EntityLiving.java:3275) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.movementTick(EntityHuman.java:595) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.tick(EntityLiving.java:2961) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.tick(EntityHuman.java:301) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.level.EntityPlayer.playerTick(EntityPlayer.java:689) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.network.PlayerConnection.tick(PlayerConnection.java:331) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.network.NetworkManager.a(NetworkManager.java:555) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:201) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1664) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:493) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1490) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1283) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[patched_1.17.1.jar:git-Purpur-1390]
    at java.lang.Thread.run(Thread.java:831) [?:?]
    [08:39:17 ERROR]: Could not pass event PlayerInteractEvent to Blocks_To_Commands vv5.0.0-beta.6
    java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.EquipmentSlot.equals(Object)" because "e" is null
    at me.ILoveAMac.BTC.listeners.PlayerInteract.onClick(PlayerInteract.java:37) ~[BlocksToCommands_1.9-1.15.2-v5.0.0-beta.6.jar:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor200.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Purpur-1390]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:542) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:505) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:500) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.level.block.BlockRedstoneOre.stepOn(BlockRedstoneOre.java:49) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.Entity.move(Entity.java:1038) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.a(EntityLiving.java:2858) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.g(EntityLiving.java:2813) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.g(EntityHuman.java:1640) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.movementTick(EntityLiving.java:3275) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.movementTick(EntityHuman.java:595) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.tick(EntityLiving.java:2961) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.tick(EntityHuman.java:301) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.level.EntityPlayer.playerTick(EntityPlayer.java:689) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.network.PlayerConnection.tick(PlayerConnection.java:331) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.network.NetworkManager.a(NetworkManager.java:555) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:201) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1664) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:493) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1490) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1283) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[patched_1.17.1.jar:git-Purpur-1390]
    at java.lang.Thread.run(Thread.java:831) [?:?]
    [08:39:17 ERROR]: Could not pass event PlayerInteractEvent to Blocks_To_Commands vv5.0.0-beta.6
    java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.EquipmentSlot.equals(Object)" because "e" is null
    at me.ILoveAMac.BTC.listeners.PlayerInteract.onClick(PlayerInteract.java:37) ~[BlocksToCommands_1.9-1.15.2-v5.0.0-beta.6.jar:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor200.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Purpur-1390]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:542) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:505) ~[patched_1.17.1.jar:git-Purpur-1390]
    at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:500) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.level.block.BlockRedstoneOre.stepOn(BlockRedstoneOre.java:49) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.Entity.move(Entity.java:1038) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.a(EntityLiving.java:2858) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.g(EntityLiving.java:2813) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.g(EntityHuman.java:1640) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.movementTick(EntityLiving.java:3275) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.movementTick(EntityHuman.java:595) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.EntityLiving.tick(EntityLiving.java:2961) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.world.entity.player.EntityHuman.tick(EntityHuman.java:301) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.level.EntityPlayer.playerTick(EntityPlayer.java:689) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.network.PlayerConnection.tick(PlayerConnection.java:331) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.network.NetworkManager.a(NetworkManager.java:555) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:201) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1664) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:493) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1490) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1283) ~[patched_1.17.1.jar:git-Purpur-1390]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[patched_1.17.1.jar:git-Purpur-1390]
  3. Ronal99
    Ronal99
    5/5,
    Version: v5.0.0-beta.6
    good plugin but, can you add cooldown for use? per user? like 5 seconds, 10 minutes etc
  4. StalkerArea51
    StalkerArea51
    4/5,
    Version: v5.0.0-beta.6
    i guess the dev is no longer active.....
    hoping he can fix error spam when player step on pressure plate...
  5. Erazer1337
    Erazer1337
    5/5,
    Version: v5.0.0-beta.6
    Realy nice Plugin.
    It would be realy nice if you can add a way to limit a block use, so players, only can use this block once or twice.
    Great job definetly 5 Stars. :)
  6. grdfjygfg
    grdfjygfg
    5/5,
    Version: v5.0.0-beta.6
    вввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввв
  7. FraiSai
    FraiSai
    1/5,
    Version: v5.0.0-beta.6
    Works, but very bad on version 1.16.2 spam with errors in the console, please fix it then it will be 5 stars
  8. tommimoro
    tommimoro
    5/5,
    Version: v5.0.0-beta.6
    ehy, any chances you could make the plugin work with "gui opening" commands? except from this amazing plugin :)
  9. hyenagodking
    hyenagodking
    3/5,
    Version: v5.0.0-beta.6
    It was working for a day but now it saying null when I click on some signs I created with /btc and showing errors in the console.
  10. LordManzana
    LordManzana
    5/5,
    Version: v5.0.0-beta.6
    I'll change my previous rating of 3 starts to 5. The owner DM me and fixed it. Hope a new release comes soon with the fix.

    The problem was the plugin doesen't work with custom heads, now it is :)
    1. ILoveAMac
      Author's Response
      Happy to help :D