Class BracketHandlers
java.lang.Object
com.blamejared.crafttweaker.api.bracket.BracketHandlers
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.entity.ai.attributes.AttributegetAttribute(String tokens) static net.minecraft.world.level.block.BlockGets the giveBlock.static net.minecraft.world.level.block.state.BlockStategetBlockState(String tokens) Creates a Blockstate based on the given inputs.static net.minecraft.world.level.block.state.BlockStategetBlockState(String name, String properties) static net.minecraft.world.level.block.state.BlockStategetBlockState(net.minecraft.world.level.block.Block block, String name, String properties) static net.minecraft.world.item.enchantment.EnchantmentgetEnchantment(String tokens) Gets the enchantment based on registry name.static net.minecraft.world.entity.EntityType<net.minecraft.world.entity.Entity>getEntityType(String tokens) Gets the entityType based on registry name.static IFluidStackgetFluidStack(String tokens) Gets the fluid Stack based on registry name.static IItemStackGets the item based on registry name.static net.minecraft.world.effect.MobEffectgetMobEffect(String tokens) Gets the mobeffect based on registry name.static net.minecraft.world.item.alchemy.Potionstatic net.minecraft.world.entity.npc.VillagerProfessiongetProfession(String tokens) Gets the villager profession based on registry name.static IRecipeManager<?>getRecipeManager(String tokens) Gets the recipeManager based on registry name.static net.minecraft.resources.ResourceLocationgetResourceLocation(String tokens) Deprecated, for removal: This API element is subject to removal in a future version.static net.minecraft.sounds.SoundEventgetSoundEvent(String tokens) Gets a sound event based on registry name.static ITargetingStrategygetTargetingStrategy(String tokens) Gets anITargetingStrategybased on its name.static net.minecraft.world.entity.npc.VillagerTypegetVillagerType(String tokens) Gets the villager profession based on registry name.
-
Constructor Details
-
BracketHandlers
public BracketHandlers()
-
-
Method Details
-
getAttribute
@BracketResolver("attribute") public static net.minecraft.world.entity.ai.attributes.Attribute getAttribute(String tokens) -
getBlock
@BracketResolver("block") public static net.minecraft.world.level.block.Block getBlock(String tokens) Gets the giveBlock. Throws an Exception if not found- Parameters:
tokens- What you would write in the BEP call.- Returns:
- The found
Block - DocParam:
- tokens "minecraft:dirt"
-
getFluidStack
Gets the fluid Stack based on registry name. Throws an error if it can't find the fluid.- Parameters:
tokens- The Fluid's resource location- Returns:
- A stack of the liquid with amount == 1mb
- DocParam:
- tokens "minecraft:water"
-
getBlockState
@BracketResolver("blockstate") public static net.minecraft.world.level.block.state.BlockState getBlockState(String tokens) Creates a Blockstate based on the given inputs. Returns `null` if it cannot find the block, ignored invalid variants- Parameters:
tokens- The block's resource location and variants- Returns:
- The found BlockState
- DocParam:
- tokens "minecraft:acacia_planks", tokens "minecraft:furnace:facing=north,lit=false"
-
getBlockState
-
getBlockState
-
getMobEffect
@BracketResolver("mobeffect") public static net.minecraft.world.effect.MobEffect getMobEffect(String tokens) Gets the mobeffect based on registry name. Throws an error if it can't find the mobeffect.- Parameters:
tokens- The mobeffect's resource location- Returns:
- The found mobeffect
- DocParam:
- tokens "minecraft:haste"
-
getEnchantment
@BracketResolver("enchantment") public static net.minecraft.world.item.enchantment.Enchantment getEnchantment(String tokens) Gets the enchantment based on registry name. Throws an error if it can't find the enchantment.- Parameters:
tokens- The enchantment's registry name- Returns:
- The found enchantment
- DocParam:
- tokens "minecraft:riptide"
-
getEntityType
@BracketResolver("entitytype") public static net.minecraft.world.entity.EntityType<net.minecraft.world.entity.Entity> getEntityType(String tokens) Gets the entityType based on registry name. Throws an exception if it can't find the entityType.- Parameters:
tokens- The entityType's resource location- Returns:
- The found entityType
- DocParam:
- tokens "minecraft:pig"
-
getItem
Gets the item based on registry name. Throws an error if it can't find the item.- Parameters:
tokens- The item's resource location- Returns:
- The found item
- DocParam:
- tokens "minecraft:dirt"
-
getPotion
@BracketResolver("potion") public static net.minecraft.world.item.alchemy.Potion getPotion(String tokens) -
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>`- Parameters:
tokens- The recipeManager's resource location- Returns:
- The found recipeManager
- DocParam:
- tokens "minecraft:crafting"
-
getResourceLocation
@Deprecated(forRemoval=true) public static net.minecraft.resources.ResourceLocation getResourceLocation(String tokens) Deprecated, for removal: This API element is subject to removal in a future version.Creates a Resource location based on the tokens. Throws an error if the tokens are not a valid location.- Parameters:
tokens- The resource location- Returns:
- The location
- DocParam:
- tokens "minecraft:dirt"
-
getProfession
@BracketResolver("profession") public static net.minecraft.world.entity.npc.VillagerProfession getProfession(String tokens) Gets the villager profession based on registry name. Throws an exception if it can't find the profession.- Parameters:
tokens- The profession's resource location- Returns:
- The found profession
- DocParam:
- tokens "minecraft:armorer"
-
getSoundEvent
@BracketResolver("soundevent") public static net.minecraft.sounds.SoundEvent getSoundEvent(String tokens) Gets a sound event based on registry name. Throws an exception if it can't find the sound event.- Parameters:
tokens- The sound event's resource location- Returns:
- The found sound event
- DocParam:
- tokens "minecraft:ambient.cave"
-
getTargetingStrategy
@BracketResolver("targetingstrategy") public static ITargetingStrategy getTargetingStrategy(String tokens) Gets anITargetingStrategybased on its name.Throws an exception if the strategy doesn't exist.
- Parameters:
tokens- The strategy's resource location- Returns:
- The found targeting strategy
- Since:
- 10.0.0
- DocParam:
- tokens "crafttweaker:default"
-
getVillagerType
@BracketResolver("villagertype") public static net.minecraft.world.entity.npc.VillagerType getVillagerType(String tokens) Gets the villager profession based on registry name. Throws an exception if it can't find the profession.- Parameters:
tokens- The profession's resource location- Returns:
- The found profession
- DocParam:
- tokens "minecraft:armorer"
-
ResourceLocationBracketHandler.getResourceLocation(String)instead.