BracketHandlers
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.bracket.BracketHandlers;
Description
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.Members
Returns: The found banner pattern
BracketHandlers.getBannerPattern("minecraft:square_bottom_left");
Parameters:
tokens: string
Type: string
- The banner pattern's resource location
Return Type:
BannerPattern
null
if it cannot find the block, ignored invalid variantsReturns: The found BlockState
BracketHandlers.getBlockState("minecraft:acacia_planks");
Parameters:
tokens: string
Type: string
- The block's resource location and variants
Return Type:
BlockState
Returns: The found data component type
BracketHandlers.getComponentType("minecraft:max_stack_size");
Parameters:
tokens: string
Type: string
- The data component type's resource location
Return Type:
DataComponentType<T>
Returns: The found enchantment
BracketHandlers.getEnchantment("minecraft:riptide");
Parameters:
tokens: string
Type: string
- The enchantment's registry name
Return Type:
Enchantment
Returns: The found entityType
BracketHandlers.getEntityType("minecraft:pig");
Parameters:
tokens: string
Type: string
- The entityType's resource location
Return Type:
EntityType<Entity>
Returns: A stack of the liquid with amount == 1mb
BracketHandlers.getFluidStack("minecraft:water");
Parameters:
tokens: string
Type: string
- The Fluid's resource location
Return Type:
IFluidStack
Returns: The found instrument
BracketHandlers.getInstrument("minecraft:ponder_goat_horn");
Parameters:
tokens: string
Type: string
- The instrument's resource location
Return Type:
Instrument
Returns: The found item
BracketHandlers.getItem("minecraft:dirt");
Parameters:
tokens: string
Type: string
- The item's resource location
Return Type:
IItemStack
Returns: The found mobeffect
BracketHandlers.getMobEffect("minecraft:haste");
Parameters:
tokens: string
Type: string
- The mobeffect's resource location
Return Type:
MobEffect
Returns: The found profession
BracketHandlers.getProfession("minecraft:armorer");
Parameters:
tokens: string
Type: string
- The profession's resource location
Return Type:
VillagerProfession
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
BracketHandlers.getRecipeManager("minecraft:crafting");
Parameters:
tokens: string
Type: string
- The recipeManager's resource location
Return Type:
IRecipeManager<?>
Returns: The found sound event
BracketHandlers.getSoundEvent("minecraft:ambient.cave");
Parameters:
tokens: string
Type: string
- The sound event's resource location
Return Type:
SoundEvent
ITargetingStrategy
based on its name.Throws an exception if the strategy doesn't exist.
Returns: The found targeting strategy
BracketHandlers.getTargetingStrategy("crafttweaker:default");
Parameters:
tokens: string
Type: string
- The strategy's resource location
Return Type:
ITargetingStrategy
Returns: The found trim material
BracketHandlers.getTrimMaterial("minecraft:quartz");
Parameters:
tokens: string
Type: string
- The trim material's resource location
Return Type:
TrimMaterial
Returns: The found trim pattern
BracketHandlers.getTrimPattern("minecraft:sentry");
Parameters:
tokens: string
Type: string
- The trim pattern's resource location
Return Type:
TrimPattern
Returns: The found profession
BracketHandlers.getVillagerType("minecraft:armorer");
Parameters:
tokens: string
Type: string
- The profession's resource location
Return Type:
VillagerType