Minecraft Mods

CommandBlockScript

  • 5,190 views, 1 today
  • 147 downloads, 0 today
  • 13
  • 10
  • 11
Lexxer's Avatar Lexxer
Level 29 : Expert Caveman
16
CommandBlockScript is a powerful scripting language for command blocks.

CBS provides a simple syntax and no limitations.

In order to use CBS you need nothing more as a simple texteditor,
CBS will then parse a valid text file into a .schematic file.

You then can easily export the created .schematic file into Minecraft.

A full documentation can be found here:
Spoiler - click to reveal
CBS's syntax consists out of 5 key words and a 4 symbols:
Key words:
"init:"
"execute:#"
"repeat"
"var"
"func"

A detailed explanation:
init:
Spoiler - click to reveal
"init:"  determinds, that the following code, will be "initiation" code.
As such it will be called at the very beginning of the programm:

undefined

The above code will create a command block, which then will execute the command "/scoreboard objectives add my_object dummy"
execute:#:
Spoiler - click to reveal
"execute:#" determinds the beginning of a new commandLine.
A commandLine can contain up to  3840 command blocks.
All commands in a commandLine (excpect determind otherwise) are chain_command_blocks.
Note: All commandLines get called parallel.
undefined
repeat:
Spoiler - click to reveal
"repeat"
followed by "(Nx)", for N ∈ ℕ \ {0} and x = any character or character
sequenz, determinds, that the following code will be repeated N  times (startign at 0), x
is a count variable, which allows access to the actuel loop.
repeat has to be in init: or execute:#:
undefined

The above code will create 2 command blocks with the command "/scoreboard players add @a my_object 0" and
"/scoreboard players add @a my_object 1"
var:
Spoiler - click to reveal
"var"
determinds the declaration of a variable, once declared a variable can
be accessed anywhere by putting the name in "%". A variable also need
to be initialized directly:
undefined

The above code creates two command blocks with the commands "/time set day" and "/summon Zombie ~ ~1 ~ {NoAI:1}"

In CBS you can also create arrays:
undefined

Every row represents 1 value of the array.
To access a array just write the name in "%" and put in the value you want to acces (starting at 0).
"#say %my_array[1]%"
func:
Spoiler - click to reveal
In CBS you can also declare functions, the following code shows a simple function:
undefined

In the above example, we declare a new function called "foo" without parameters and call it later.
When we call a function, the function gets replaced by the actual code, in this example only one command
"/say i am a function!".
You can also call a function inside a function, but be aware recrusive functions aren't possible!
undefined

A function with parameters:
undefined

The above code will create a command block with the command "/summon Zombie ~ ~1 ~ {NoAi:1}"

And you can of course pass function parameters as parameter to other functions:
undefined

The
example above first initiates the scoreboard and creates a variable
called "object", the commandLine contains 2 command blocks with the
commands "/scoreboard players add @a my_object 1" and "/say added 1 to
all for my_object"

Parameters:
Spoiler - click to reveal
Parameters are used in order to change the proccess of generation.
CBS knows 9 different parameters:

undefined


CBS also provides a debug mode, it allows an even easier bugtracking:
undefined

In order to get an even better overview, cbs now implements a "RawData" creater.
The "RawData" creator creates a simple .txt file with informations about alle commands:
undefined
Progress100% complete
Game VersionMinecraft 1.8.1
Tags

2 Update Logs

Update #2 : by Lexxer 01/15/2016 7:21:05 amJan 15th, 2016

Update:
added Compile option to Debug mode

Fixed:
- "-r" not recognized
LOAD MORE LOGS

Create an account or sign in to comment.

1
01/14/2016 7:46 pm
Level 4 : Apprentice Explorer
DFTBAman
DFTBAman's Avatar
I have had an issue. When I used the -r parameter to make a need redstone command block, the debug menu says 'Error occurred on line 29: " -r"'. Once I removed the -r it didn't have any problems.

For reference, this is what I had on line 29:

-r #kill @e[type=ArmorStand,name=center]
1
01/15/2016 7:25 am
Level 29 : Expert Caveman
Lexxer
Lexxer's Avatar
fixed, should work now :)
1
01/11/2016 2:26 am
Level 51 : Grandmaster Nerd
JustusFT
JustusFT's Avatar
I've been looking for a good 1.9 scripting language. Good job!
1
01/11/2016 8:21 am
Level 29 : Expert Caveman
Lexxer
Lexxer's Avatar
Thanks! :)
1
01/10/2016 5:17 pm
Level 4 : Apprentice Explorer
DFTBAman
DFTBAman's Avatar
This program is incredibly useful, but one thing I would like is being able to go straight from the debug menu to where you can compile from. Currently I have to close the program, reopen it, and open the file in order to compile after debugging.
1
01/10/2016 5:29 pm
Level 29 : Expert Caveman
Lexxer
Lexxer's Avatar
Thanks! It's good to know, that there are others whose live this makes easier, also i will update the version  and implement this soon :)
1
01/10/2016 5:14 pm
Level 4 : Apprentice Explorer
DFTBAman
DFTBAman's Avatar
I have a problem: When I use Init in code, then compile and import it into a world, the command block doesn't run. The right command is put into the block but the command doesn't run when I import it.

Here is the Init code I am using if it helps:

//add armor objective
Init:{
#scoreboard objectives add armor armor
}
1
01/10/2016 5:26 pm
Level 29 : Expert Caveman
Lexxer
Lexxer's Avatar
The solution, which worked for me, was to replace the first command block and reload the world :)
1
01/08/2016 10:52 pm
Level 1 : New Miner
justaminit
justaminit's Avatar
Thanks for this effort!
How do we use the cbs.jar?
1
01/09/2016 5:28 am
Level 29 : Expert Caveman
Lexxer
Lexxer's Avatar
You just need to double click it and it will ask you for the file to read :)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome