This class contains the "simple" Bracket handlers from CraftTweaker. However, some Bracket handlers, like for recipeTypes, tags, tagManagers, won't be shown here as they use a different internal structure.

Diese Klasse importieren

Link to diese-klasse-importieren

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.

ZenScript
Copy
import crafttweaker.api.bracket.BracketHandlers;

Name: getAttribute

Return Type: Attribute

ZenScript
Copy
BracketHandlers.getAttribute(tokens as string) as Attribute
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
No Description Provided

Name: getBlock

Gets the give Block. Throws an Exception if not found

Returns: The found Block
Return Type: Block

ZenScript
Copy
// BracketHandlers.getBlock(tokens as string) as Block

BracketHandlers.getBlock("minecraft:dirt");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
Was Sie in den BEP-Aufruf schreiben würden.

Name: getBlockState

Creates a Blockstate based on the given inputs.
Returns null if it cannot find the block, ignored invalid variants

Returns: The found BlockState
Return Type: BlockState

ZenScript
Copy
// BracketHandlers.getBlockState(tokens as string) as BlockState

BracketHandlers.getBlockState("minecraft:acacia_planks");
BracketHandlers.getBlockState("minecraft:furnace:facing=north,lit=false");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The block's resource location and variants

Name: getDamageSource

Gets a damage source based on type.
If the damage source is not pre-registered, it will create a new one with the given name

Returns: The found pre-registered damage source or a new one
Return Type: DamageSource

ZenScript
Copy
// BracketHandlers.getDamageSource(tokens as string) as DamageSource

BracketHandlers.getDamageSource("magic");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
the damage sources' type

Name: getEnchantment

Gets the enchantment based on registry name. Throws an error if it can't find the enchantment.

Returns: The found enchantment
Return Type: Enchantment

ZenScript
Copy
// BracketHandlers.getEnchantment(tokens as string) as Enchantment

BracketHandlers.getEnchantment("minecraft:riptide");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The enchantment's registry name

Name: getEntityType

Gets the entityType based on registry name. Throws an exception if it can't find the entityType.

Returns: The found entityType
Return Type: EntityType

ZenScript
Copy
// BracketHandlers.getEntityType(tokens as string) as EntityType

BracketHandlers.getEntityType("minecraft:pig");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The entityType's resource location

Name: getItem

Gets the item based on registry name. Throws an error if it can't find the item.

Returns: The found item
Return Type: IItemStack

ZenScript
Copy
// BracketHandlers.getItem(tokens as string) as IItemStack

BracketHandlers.getItem("minecraft:dirt");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The item's resource location

Name: getItemGroup

Gets an CreativeModeTab by name.
Will throw an error if the tab could not be found!

Returns: The found ItemGroup
Return Type: CreativeModeTab

ZenScript
Copy
// BracketHandlers.getItemGroup(tokens as string) as CreativeModeTab

BracketHandlers.getItemGroup(misc);
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The CreativeModeTab's name.

Name: getMaterial

Gets the given Material. Throws an Exception if not found.

Returns: The found Material
Return Type: Material

ZenScript
Copy
// BracketHandlers.getMaterial(tokens as string) as Material

BracketHandlers.getMaterial("earth");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
Was Sie in den BEP-Aufruf schreiben würden.

Name: getMobEffect

Gets the mobeffect based on registry name. Throws an error if it can't find the mobeffect.

Returns: The found mobeffect
Return Type: MobEffect

ZenScript
Copy
// BracketHandlers.getMobEffect(tokens as string) as MobEffect

BracketHandlers.getMobEffect("minecraft:haste");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The mobeffect's resource location

Name: getPotion

Return Type: Potion

ZenScript
Copy
BracketHandlers.getPotion(tokens as string) as Potion
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
No Description Provided

Name: getProfession

Gets the villager profession based on registry name. Throws an exception if it can't find the profession.

Returns: The found profession
Return Type: VillagerProfession

ZenScript
Copy
// BracketHandlers.getProfession(tokens as string) as VillagerProfession

BracketHandlers.getProfession("minecraft:armorer");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The profession's resource location

Link to getRecipeManager

Name: getRecipeManager

Gets the recipeManager based on registry name. Throws an error if it can't find the recipeManager.
Throws an exception if the given recipeType is not found.

This will always return IRecipeManager.

There is also a BEP for that but that works differently so it can't be automatically added to the docs here.
But the BEP looks the same as the other ones: <recipetype:minecraft:crafting>

Returns: The found recipeManager
Return Type: IRecipeManager

ZenScript
Copy
// BracketHandlers.getRecipeManager(tokens as string) as IRecipeManager

BracketHandlers.getRecipeManager("minecraft:crafting");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The recipeManager's resource location

Link to getResourceLocation

Name: getResourceLocation

Creates a Resource location based on the tokens.
Throws an error if the tokens are not a valid location.

Returns: The location
Return Type: ResourceLocation

ZenScript
Copy
// BracketHandlers.getResourceLocation(tokens as string) as ResourceLocation

BracketHandlers.getResourceLocation("minecraft:dirt");
ParameterTypeBeschreibung
Parameter
tokens
Type
string
Beschreibung
The resource location