Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers

IBlockPattern

An IBlockPattern is an interface that allows for combining several blocks into one object.
It is comparable to what the IIngredient Interface is to IItemStacks.

Importing the package

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.
import crafttweaker.block.IBlockPattern;

Calling an IBlockPattern Object

Technically, each time you call an IBlock object, you call an IBlockPattern object.
But there are cases when you explicitly get an IBlockPattern Object as return.

ZenGetters

ZenGetterWhat does it doReturn Type
ZenGetter
blocks
What does it do
Lists all possible blocks for this object
Return Type
List<IBlock>
ZenGetter
displayName
What does it do
Returns the displayNames of the fitting blocks
Return Type
string

OR

You can OR two IBlockPattern Objects using the OR | Operator

Matching

You can check if an IBlockPatternObject contains another using the in keyword.
For example, you could check if a Block is in an IBlockPattern.