Bar element
Add a bar that fills depending on a number value stored in the machine.
Example: setting a number in the data from a script
.requireFunctionEachTicks(ctx => {
//Set the variable named "amount" to 10
//"amount" can be replaced by anything else,
//as long as it match the ID specified in the bar gui element properties.
ctx.machine.data.amount = 10;
return ctx.success()
}).requireFunctionEachTicks((ctx as Context) => {
//Set the variable named "amount" to 10
//"amount" can be replaced by anything else,
//as long as it match the ID specified in the bar gui element properties.
ctx.machine.data.amount = 10;
return ctx.success();
});Properties
Mandatory properties
"type": "custommachinery:bar" //Mandatory to define a bar element.Optional properties
Example
Last updated