HomeJavaModsCommand Block API
Command Block API
ModsJava

Command Block API

For people that want the power of plugins with the simplicity of command blocks. Free Minecraft Java mod for 1.12.

⬇ Download on Spigot
This plugin is for people that don't know how to use java very well, but did learn command blocks.

!! This plugin is in alpha, that means that there are probably alot of bugs in it !!

This is one of my first plugins, so don't be mad if I a little stupid :D

This is the way you import the api to your code:
Code (Text):
private CmdBlockAPI api = (CmdBlockAPI) Bukkit.getServer().getPluginManager().getPlugin("CommandBlockAPI");
This are the methods that you can use (In 0.7 alpha):
Code (Text):
api.runCommand(<Command>);
api.runCommandAmount(<Command>, <Amount>);
api.runCommandDelay(<Command>, <Ticks>);
api.runCommands(<Array Of Commands>);
api.createCommandLoop(<Array Of Commands>, <Ticks>);
api.runOnJoin(<Array Of Commands>);
api.runOnClickWithItem(<Array Of The Commands>, <Material Of The Item>);
api.runOnClickOnEntity(<Array Of The Commands>, <EntityType>);
api.runOnEntityDamage(<Array Of The Commands>);
//Or:
api.runOnEntityDamage(<Array Of The Commands>, <EntityType>);

// example:
api.runCommand("say This runs once");

api.runCommandAmount("say This runs 6 times", 6);

api.runCommandDelay("say This will run in 5 seconds / 100 ticks", 100);

String cmds[] ={"say This will run first",
"say This will run second"};
api.runCommands

String loopCmds[] ={"say This will run every 40 ticks / 2 seconds",
"say It will never stop"};
api.createCommandLoop(loopCmds, 40);

String joinCmds[]={"say You can use <player> here to reference the joining player",
"give <player> minecraft:golden_hoe"}
api.runOnJoin(joinCmds)

String diamondCmds[]={"say You can use <player> here to reference the player",
"execute <player> ~ ~ ~ summon zombie"}
api.runOnClickWithItem(diamondCmds, Material.DIAMOND)

String creeperCmds[] ={"say You can use <player> to reference the player",
"say You can use <entity> to reference the entity",
"execute <player> ~ ~ ~ teleport <entity> ~ ~2 ~"};
api.runOnClickOnEntity(creeperCmds, EntityType.CREEPER)

String damageCmds[] ={"say You can use <entity> to reference the entity",
"execute <entity> ~ ~ ~ particle blockcrack ~ ~1 ~ 0 0.5 0 0 20 normal @a 152"};
api.runOnEntityDamage(damageCmds)

String ironGolemCmds[] ={"say This will run for a specific type of entity",
"execute <entity> ~ ~ ~ particle blockcrack ~ ~1 ~ 0 1 0 0 20 normal @a 42"};
api.runOnEntityDamage(ironGolemCmds, EntityType.IRON_GOLEM)

 
Also, you can use variables and color codes in your commands:
Code (Text):
api.runCommand("say " + ChatColor.GREEN + "I'm so fancy!!!");
int t = 5;
api.runCommandAmount("say This will run " + t + " times", t);


I know, all ya' plugin devs are laughing because how basic this is. But the idea is that it will be simple for everybody to code plugins for their server.

Future features:
- Easy Custom Command Making
- Easy Event Handling
- And... More to come...

Because to use this plugin you still need the basic plugin knowledge, this is the first episode of spigot / bukkit coding tutorial by DGtv:


And this is another tutorial by DGtv on how to add APIs to your plugin:


Please tell me about any bugs you find in the discussion tab, I will make a GitHub Issus and Wiki soon.

Commands

Plugin details

Read from the plugin's own plugin.yml.

Command Block API is a free Minecraft Java mod. Compatible with Minecraft 1.12. Downloaded 647 times (via Spigot). Download it and open it directly in the game.

Explore more