MC1253

MC1253 is an IC that can play a firework show using 2 available scripting languages implemented into CraftBook. Scripts go inside the /config/craftbook/fireworks folder, and come in either .txt or .fwk file formats.

Firework Languages

There are two firework languages in CraftBook. A simple one called Basic, which is good for quick single firework scripts. Or Fyrestone, which is a bit more involved, but ultimately better for larger scripts.

Basic

Basic files end with the .txt filetype. The syntax of ‘Basic’ is the following,

launch:xOff,yOff,zOff;duration;shape;r,g,b colour;r,g,b fade;effect

The xOff, yOff, and zOff parameters refer to the offset that the firework will be launched from.

The duration refers to the duration of the flight, in seconds.

The shape refers to the ‘type’ of the firework. The shape can be any from this list, or any provided by another mod.

The r,g,b colour, and r,g,b fade, are the base colours and fade colours respectively.

The effect is an optional parameter that can currently be either trail or twinkle, to apply those effects to the firework.

Example

launch:0,2,0;1;burst;255,0,0;0,0,255;twinkle

Fyrestone

Fyrestone files are .fwk files.

Fyrestone follows the lines of some very basic languages. It supports multiple effects per firework, and each firework can be launched multiple times.

The language is effect based, where you can add effects to a defined variable.

It is done like this:

To define a variable, or to add to a variable... Type:

start <variableName>

After that, you enter all the effects you want in this format:

set.color 255,0,0
set.fade 255,0,0
set.shape burst
set.trail
set.twinkle

You do not need to include all of these, you can select whichever ones you want. However shape is required.

And to end off the construction, you type build <variableName>, signifying that effect is done. To add a second effect to the variable repeat the process.

Durations are not bound to variables, they are set seperately. To set a duration, type: duration <duration in seconds> The duration will be applied until it is changed again.

Locations are done the same way, location x,y,z

You can also wait a certain number of ticks using... wait <ticks>

You can have spaces between the lines to make it neater, and start lines with a # to make it a comment.

Commands

Command Parameters Description Example
start Name<string> Starts building a new firework, the first parameter is the name. start MyFirework
build Name<string> Finishes building a new firework and stores it, the first parameter is the name. build MyFirework
set.color R<integer>,G<integer>,B<integer>

Sets the color of the firework.

Multiple can be set for random colours.

set.color 255,0,0
set.fade R<integer>,G<integer>,B<integer>

Sets the color of the firework.set.trail: set.fade will set color for trail.

Multiple can be set for random colours.

set.fade 0,255,0
set.shape Shape<string> Sets the shape of the firework. The shape can be any from this list, or any provided by another mod. set.shape creeper
set.twinkle None Enables twinkles on the firework. set.twinkle
set.trail None Enables trails on the firework. set.trail
set.flicker None Enables flicker on the firework set.flicker
duration Time<decimal> Sets the time (in seconds) the firework takes to explode. duration 1.5
location X<decimal>,Y<decimal>,Z<decimal> Sets the offset spawn point for the firework from the IC sign. This is not absolute coordinates, but an offset! location 0,32,0
launch Name<string> Launches the specified firework. launch MyFirework
wait Ticks<integer> Waits for a specified amount of ticks. wait 20
sound SoundName<string> X<decimal>,Y<decimal>,Z<decimal> Volume<decimal> Pitch<decimal> Plays a sound at an offset. sound FUSE 0,0,0 2.0 1.0

Example

# Adding 2 effects to variable a

start a
set.color 255,255,255
set.type creeper
set.flicker
set.fade 255,0,0
build a

start a
set.color 0,255,0
set.type lball
set.trail
set.fade 0,0,255
build a

# Launch a
launch a

# Launch a another 2 times in different locations
location -1,2,3
launch a
location 4,-2,7
launch a

# Make another effect and launch it at the sign
start b
set.color 30,255,80
set.type burst
set.trail
set.fade 255,0,0
build b
location 0,0,0
launch b

Sign Lines

  1. FIREWORK
  2. [MC1253]
  3. Firework Script Name
  4. Stop on Low (true/false)

IC Pins

Inputs

  • Runs script on high

Outputs

  • None

Permissions

Node Description Default Role
craftbook.ic.safe.mc1253 Allows creation of the Programmable Firework Display (MC1253) IC. user