Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes

CoTBlockAdvanced

A registered CoT Block. Used for advanced functionality. like onRandomTick, onReplaced etc.

These functions should be run in CraftTweaker scripts, instead of ContentTweaker ones. And they are reloadable. You can get it via advanced block BEP.

This class was added by a mod with mod-id contenttweaker. So you need to have this mod installed if you want to use this feature.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import mods.contenttweaker.block.advance.CoTBlockAdvanced;

Methods

The block’s color

Returns: the CoTBlockAdvanced, used for method chaining.
Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setBlockColorSupplier(func as IBlockColorSupplier) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockColorSupplier
Description
An IBlockColorSupplier. The tintIndex argument is defined by its model

Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setIsSideInvisible(func as IBlockIsSideInvisible) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockIsSideInvisible
Description
No Description Provided

Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setIsTransparent(func as IBlockIsTransparent) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockIsTransparent
Description
No Description Provided

Sets what will happen when a player right-clicks the block

Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setOnActivated(func as IBlockActivated) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockActivated
Description
An IBlockActivated function, the function should return an ActionResultType

Sets what will happen when the block is added.

Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setOnAdded(func as IBlockAdded) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockAdded
Description
No Description Provided

Sets what will happen when a neighbour of the block is changed

Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setOnNeighborChanged(func as IBlockNeighborChanged) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockNeighborChanged
Description
No Description Provided

Sets what will happen when the block receive a random tick. Throws an exception if the block does not tick randomly.

Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setOnRandomTick(func as IBlockRandomTick) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockRandomTick
Description
No Description Provided

Sets what will happen when the block is replaced. (Note. destroy means replace with air)

Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced

script.zs
CoTBlockAdvanced.setOnReplaced(func as IBlockReplaced) as CoTBlockAdvanced
ParameterTypeDescription
Parameter
func
Type
IBlockReplaced
Description
No Description Provided