Class XTag<T extends XBase<?,?>>

java.lang.Object
com.cryptomorin.xseries.XTag<T>

public final class XTag<T extends XBase<?,?>> extends Object
A class used for grouping various things together based on a common trait. This class is kind of memory-heavy and should not be initialized when not needed, on the other hand if you're going to use this class, it's recommended to intialize it from before, since the startup may take a while and cause a single lag spike.

The main usage of this class is simply done by choosing your category and using isTagged(XBase) or getValues():


 boolean isTagged = XTag.CATEGORY.isTagged(element);
 Set<T> values = XTag.CATEGORY.getValues();
 

You may also want to make this easier as a configurable value for users to change using stringMatcher(Collection, Collection):


 List<Matcher<E>> compiledMatchers = XTag.stringMatcher(elements); // for compiled matchers
 boolean anyMatched = XTag.anyMatchString(element, compiledMatchers); // or pass the elements directly
 

You can also use some kind of registry-based system for tags using getTag(String). However, not all methods here follow the common XTag system, and there are a few tags that are only available as a static boolean method, such as isInteractable(XMaterial) and isItem(XMaterial).

  • Field Details

    • AIR

      @NotNull public static final @NotNull XTag<XMaterial> AIR
    • INVENTORY_NOT_DISPLAYABLE

      @NotNull public static final @NotNull XTag<XMaterial> INVENTORY_NOT_DISPLAYABLE
    • ACACIA_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> ACACIA_LOGS
      Tag representing all acacia log and bark variants
    • CORAL_FANS

      @NotNull public static final @NotNull XTag<XMaterial> CORAL_FANS
    • ALIVE_CORAL_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> ALIVE_CORAL_BLOCKS
    • ALIVE_CORAL_FANS

      @NotNull public static final @NotNull XTag<XMaterial> ALIVE_CORAL_FANS
      Tag representing all dead coral non-walled fans
    • ALIVE_CORAL_PLANTS

      @NotNull public static final @NotNull XTag<XMaterial> ALIVE_CORAL_PLANTS
      Tag representing all non-dead coral plants
    • ALIVE_CORAL_WALL_FANS

      @NotNull public static final @NotNull XTag<XMaterial> ALIVE_CORAL_WALL_FANS
    • SPAWN_EGGS

      @NotNull public static final @NotNull XTag<XMaterial> SPAWN_EGGS
    • ANIMALS_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> ANIMALS_SPAWNABLE_ON
      Tag representing all possible blocks available for animals to spawn on
    • ANVIL

      @NotNull public static final @NotNull XTag<XMaterial> ANVIL
      Tag representing all variants of anvil
    • AXOLOTL_TEMPT_ITEMS

      @NotNull public static final @NotNull XTag<XMaterial> AXOLOTL_TEMPT_ITEMS
      Tag representing all items that can tempt axolotl
    • AXOLOTLS_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> AXOLOTLS_SPAWNABLE_ON
      Tag representing all possible blocks for axolotls to spawn on
    • AZALEA_GROWS_ON

      @NotNull public static final @NotNull XTag<XMaterial> AZALEA_GROWS_ON
      Tag representing all possible blocks for azalea to grow on
    • AZALEA_ROOT_REPLACEABLE

      @NotNull public static final @NotNull XTag<XMaterial> AZALEA_ROOT_REPLACEABLE
      Tag representing all possible blocks that can be replaced by azalea
    • BAMBOO_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> BAMBOO_LOGS
      Tag representing all bamboo wood variants
    • BAMBOO_PLANTABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> BAMBOO_PLANTABLE_ON
      Tag representing all possible blocks bamboo may be planted on
    • BANNERS

      @NotNull public static final @NotNull XTag<XMaterial> BANNERS
      Tag representing all banner blocks
    • BASE_STONE_NETHER

      @NotNull public static final @NotNull XTag<XMaterial> BASE_STONE_NETHER
      Tag representing the nether base materials
    • BASE_STONE_OVERWORLD

      @NotNull public static final @NotNull XTag<XMaterial> BASE_STONE_OVERWORLD
      Tag representing the overworld base materials
    • BEACON_BASE_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> BEACON_BASE_BLOCKS
      Tag representing all possible blocks that can be used as beacon base
    • BEDS

      @NotNull public static final @NotNull XTag<XMaterial> BEDS
      Tag representing all possible variants of bed
    • BEE_GROWABLES

      @NotNull public static final @NotNull XTag<XMaterial> BEE_GROWABLES
      Tag representing all possible blocks/crops that be grown by bees
    • BIG_DRIPLEAF_PLACEABLE

      @NotNull public static final @NotNull XTag<XMaterial> BIG_DRIPLEAF_PLACEABLE
      Tag representing all possible blocks big dripleaf may be planted on
    • BIRCH_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> BIRCH_LOGS
      Tag representing all birch log and bark variants
    • BUTTONS

      @NotNull public static final @NotNull XTag<XMaterial> BUTTONS
      Tag representing all possible variants of buttons
    • CAMPFIRES

      @NotNull public static final @NotNull XTag<XMaterial> CAMPFIRES
      Tag representing all possible variants of campfires
    • CANDLE_CAKES

      @NotNull public static final @NotNull XTag<XMaterial> CANDLE_CAKES
      Tag representing all possible variants of candle cakes
    • CANDLES

      @NotNull public static final @NotNull XTag<XMaterial> CANDLES
      Tag representing all possible variants of candles
    • CARPETS

      @NotNull public static final @NotNull XTag<XMaterial> CARPETS
      Tag representing all possible variants of carpets
    • CAULDRONS

      @NotNull public static final @NotNull XTag<XMaterial> CAULDRONS
      Tag representing all possible variants of cauldrons
    • CAVE_VINES

      @NotNull public static final @NotNull XTag<XMaterial> CAVE_VINES
      Tag representing all possible variants of cave vines
    • CHERRY_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> CHERRY_LOGS
      Tag representing all cherry log and bark variants
    • CLIMBABLE

      @NotNull public static final @NotNull XTag<XMaterial> CLIMBABLE
      Tag representing all climbable blocks
    • CLUSTER_MAX_HARVESTABLES

      @NotNull public static final @NotNull XTag<XMaterial> CLUSTER_MAX_HARVESTABLES
      Tag representing all preferred items for harvesting clusters{unused as of 1.18}
    • COAL_ORES

      @NotNull public static final @NotNull XTag<XMaterial> COAL_ORES
      Tag representing all possible variants of coal ores
    • CONCRETE

      @NotNull public static final @NotNull XTag<XMaterial> CONCRETE
      Tag representing all possible variants of concrete
    • CONCRETE_POWDER

      @NotNull public static final @NotNull XTag<XMaterial> CONCRETE_POWDER
      Tag representing all possible variants of concrete_powder
    • COPPER_ORES

      @NotNull public static final @NotNull XTag<XMaterial> COPPER_ORES
      Tag representing all possible variants of copper ores
    • CORALS

      @NotNull public static final @NotNull XTag<XMaterial> CORALS
      Tag representing all corals
    • CRIMSON_STEMS

      @NotNull public static final @NotNull XTag<XMaterial> CRIMSON_STEMS
      Tag representing all crimson log and bark variants
    • CROPS

      @NotNull public static final @NotNull XTag<XMaterial> CROPS
      Tag representing all crops
    • CRYSTAL_SOUND_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> CRYSTAL_SOUND_BLOCKS
      Tag representing all possible blocks that can make crystal sounds
    • DARK_OAK_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> DARK_OAK_LOGS
      Tag representing all dark oak log and bark variants
    • DEAD_CORAL_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> DEAD_CORAL_BLOCKS
    • DEAD_CORAL_FANS

      @NotNull public static final @NotNull XTag<XMaterial> DEAD_CORAL_FANS
    • DEAD_CORAL_PLANTS

      @NotNull public static final @NotNull XTag<XMaterial> DEAD_CORAL_PLANTS
    • DEAD_CORAL_WALL_FANS

      @NotNull public static final @NotNull XTag<XMaterial> DEAD_CORAL_WALL_FANS
    • DEEPSLATE_ORE_REPLACEABLES

      @NotNull public static final @NotNull XTag<XMaterial> DEEPSLATE_ORE_REPLACEABLES
      Tag representing all possible blocks that may be replaced by deepslate ores
    • DIAMOND_ORES

      @NotNull public static final @NotNull XTag<XMaterial> DIAMOND_ORES
      Tag representing all possible variants of diamond ores
    • DIRT

      @NotNull public static final @NotNull XTag<XMaterial> DIRT
      Tag representing all dirt
    • DOORS

      @NotNull public static final @NotNull XTag<XMaterial> DOORS
      Tag representing all possible types of doors
    • DRAGON_IMMUNE

      @NotNull public static final @NotNull XTag<XMaterial> DRAGON_IMMUNE
      Tag representing all blocks that can't be destroyed by dragons
    • DRIPSTONE_REPLACEABLE

      @NotNull public static final @NotNull XTag<XMaterial> DRIPSTONE_REPLACEABLE
      Tag representing all possible blocks that can be replaced by dripstone
    • WALL_HEADS

      @NotNull public static final @NotNull XTag<XMaterial> WALL_HEADS
    • EMERALD_ORES

      @NotNull public static final @NotNull XTag<XMaterial> EMERALD_ORES
      Tag representing all variants of emerald ores
    • ENDERMAN_HOLDABLE

      @NotNull public static final @NotNull XTag<XMaterial> ENDERMAN_HOLDABLE
      Tag representing all possible blocks that can be picked up by endermen
    • FEATURES_CANNOT_REPLACE

      @NotNull public static final @NotNull XTag<XMaterial> FEATURES_CANNOT_REPLACE
      Tag representing all blocks that cant be replaced by world generation features
    • FENCE_GATES

      @NotNull public static final @NotNull XTag<XMaterial> FENCE_GATES
      Tag representing all possible variants of fence gates
    • FENCES

      @NotNull public static final @NotNull XTag<XMaterial> FENCES
      Tag representing all possible variants of fences
    • FILLED_CAULDRONS

      @NotNull public static final @NotNull XTag<XMaterial> FILLED_CAULDRONS
      Tag representing all possible variants of filled cauldron
    • FIRE

      @NotNull public static final @NotNull XTag<XMaterial> FIRE
      Tag representing all possible variants fire
    • FLOWER_POTS

      @NotNull public static final @NotNull XTag<XMaterial> FLOWER_POTS
      Tag representing all possible variants of flower pots
    • FLOWERS

      @NotNull public static final @NotNull XTag<XMaterial> FLOWERS
      Tag representing all possible types of flowers
    • FOX_FOOD

      @NotNull public static final @NotNull XTag<XMaterial> FOX_FOOD
      Tag representing all items can be used as food for fox
    • FOXES_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> FOXES_SPAWNABLE_ON
      Tag representing all possible blocks foxes may spawn on
    • FREEZE_IMMUNE_WEARABLES

      @NotNull public static final @NotNull XTag<XMaterial> FREEZE_IMMUNE_WEARABLES
      Tag representing all possible items can be used to avoid freezing
    • GEODE_INVALID_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> GEODE_INVALID_BLOCKS
      Tag representing all blocks that geodes will not spawn in
    • GLASS

      @NotNull public static final @NotNull XTag<XMaterial> GLASS
      Tag representing all variants of glass
    • GLAZED_TERRACOTTA

      @NotNull public static final @NotNull XTag<XMaterial> GLAZED_TERRACOTTA
      Tag representing all possible variants of glazed terracotta
    • GOATS_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> GOATS_SPAWNABLE_ON
      Tag representing all possible blocks goats may spawn on
    • GOLD_ORES

      @NotNull public static final @NotNull XTag<XMaterial> GOLD_ORES
      Tag representing all possible variants of gold ores
    • GUARDED_BY_PIGLINS

      @NotNull public static final @NotNull XTag<XMaterial> GUARDED_BY_PIGLINS
      Tag representing all block types that are guarded by piglins
    • HANGING_SIGNS

      @NotNull public static final @NotNull XTag<XMaterial> HANGING_SIGNS
      Tag representing all possible types of hanging signs
    • HOGLIN_REPELLENTS

      @NotNull public static final @NotNull XTag<XMaterial> HOGLIN_REPELLENTS
      Tag representing all block types that repel hoglins
    • ICE

      @NotNull public static final @NotNull XTag<XMaterial> ICE
      Tag representing all possible variants of ice
    • IGNORED_BY_PIGLIN_BABIES

      @NotNull public static final @NotNull XTag<XMaterial> IGNORED_BY_PIGLIN_BABIES
      Tag representing all items ignored by baby piglins
    • IMPERMEABLE

      @NotNull public static final @NotNull XTag<XMaterial> IMPERMEABLE
      Tag representing all possible block types that do not drip water/lava
    • INFINIBURN_END

      @NotNull public static final @NotNull XTag<XMaterial> INFINIBURN_END
      Tag representing all block types that can burn for infinitely long in the end
    • INFINIBURN_NETHER

      @NotNull public static final @NotNull XTag<XMaterial> INFINIBURN_NETHER
      Tag representing all block types that can burn for infinitely long in the nether
    • INFINIBURN_OVERWORLD

      @NotNull public static final @NotNull XTag<XMaterial> INFINIBURN_OVERWORLD
      Tag representing all block types that can burn for infinitely long in the overworld
    • INSIDE_STEP_SOUND_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> INSIDE_STEP_SOUND_BLOCKS
      Tag representing all block types that play muffled step sounds
    • IRON_ORES

      @NotNull public static final @NotNull XTag<XMaterial> IRON_ORES
      Tag representing all possible variants of iron ores
    • ITEMS_ARROWS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_ARROWS
      Tag representing all possible variants of arrows
    • ITEMS_BANNERS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_BANNERS
      Tag representing all items that can be used as banners
    • ITEMS_BEACON_PAYMENT_ITEMS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_BEACON_PAYMENT_ITEMS
      Tag representing all items that can be used to fuel beacon
    • ITEMS_BOATS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_BOATS
      Tag representing all possible variants of boats
    • ITEMS_COALS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_COALS
      Tag representing all possible variants of coal
    • ITEMS_CREEPER_DROP_MUSIC_DISCS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_CREEPER_DROP_MUSIC_DISCS
      Tag representing all possible music discs that can be dropped by creeper
    • ITEMS_FISHES

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_FISHES
      Tag representing all possible types of fish
    • ITEMS_FURNACE_MATERIALS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_FURNACE_MATERIALS
      Tag representing all furnace materials {empty in spigot as of 1.18}
    • ITEMS_LECTERN_BOOKS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_LECTERN_BOOKS
      Tag representing all possible book types that can be placed on lecterns
    • ITEMS_MUSIC_DISCS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_MUSIC_DISCS
      Tag representing all types of music discs
    • ITEMS_PIGLIN_LOVED

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_PIGLIN_LOVED
      Tag representing all items loved by piglins
    • ITEMS_STONE_TOOL_MATERIALS

      @NotNull public static final @NotNull XTag<XMaterial> ITEMS_STONE_TOOL_MATERIALS
      Tag representing all stone tool materials
    • WALL_BANNERS

      @NotNull public static final @NotNull XTag<XMaterial> WALL_BANNERS
      Tag representing all possible types of wall banners
    • JUNGLE_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> JUNGLE_LOGS
      Tag representing all jungle log and bark variants
    • LAPIS_ORES

      @NotNull public static final @NotNull XTag<XMaterial> LAPIS_ORES
      Tag representing all possible variants of lapis ores
    • LAVA_POOL_STONE_CANNOT_REPLACE

      @NotNull public static final @NotNull XTag<XMaterial> LAVA_POOL_STONE_CANNOT_REPLACE
      Tag representing all blocks that can't be replaced by lava pools
    • LEAVES

      @NotNull public static final @NotNull XTag<XMaterial> LEAVES
      Tag representing all types of leaves
    • LOGS

      @NotNull public static final @NotNull XTag<XMaterial> LOGS
      Tag representing all wood and bark variants
    • LOGS_THAT_BURN

      @NotNull public static final @NotNull XTag<XMaterial> LOGS_THAT_BURN
      Tag representing all wood and bark variants that can catch fire
    • LUSH_GROUND_REPLACEABLE

      @NotNull public static final @NotNull XTag<XMaterial> LUSH_GROUND_REPLACEABLE
      Tag representing all possible blocks that can be replaced by lush ground
    • MANGROVE_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> MANGROVE_LOGS
      Tag representing all mangrove log and bark variants
    • MINEABLE_AXE

      @NotNull public static final @NotNull XTag<XMaterial> MINEABLE_AXE
      Tag representing all block types mineable with axe
    • MINEABLE_HOE

      @NotNull public static final @NotNull XTag<XMaterial> MINEABLE_HOE
      Tag representing all block types mineable with hoe
    • MINEABLE_PICKAXE

      @NotNull public static final @NotNull XTag<XMaterial> MINEABLE_PICKAXE
      Tag representing all block types mineable with pickaxe
    • MINEABLE_SHOVEL

      @NotNull public static final @NotNull XTag<XMaterial> MINEABLE_SHOVEL
      Tag representing all block types mineable with shovel
    • MOOSHROOMS_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> MOOSHROOMS_SPAWNABLE_ON
      Tag representing all possible block types mooshrooms can spawn on
    • MOSS_REPLACEABLE

      @NotNull public static final @NotNull XTag<XMaterial> MOSS_REPLACEABLE
      Tag representing all block types that can be replaced by moss
    • MUSHROOM_GROW_BLOCK

      @NotNull public static final @NotNull XTag<XMaterial> MUSHROOM_GROW_BLOCK
    • NEEDS_DIAMOND_TOOL

      @NotNull public static final @NotNull XTag<XMaterial> NEEDS_DIAMOND_TOOL
      Tag representing all block types that need minimum of diamond tool to drop items
    • NEEDS_IRON_TOOL

      @NotNull public static final @NotNull XTag<XMaterial> NEEDS_IRON_TOOL
      Tag representing all block types that need minimum of iron tool to drop items
    • NEEDS_STONE_TOOL

      @NotNull public static final @NotNull XTag<XMaterial> NEEDS_STONE_TOOL
      Tag representing all block types that need minimum of stone tool to drop items
    • NON_FLAMMABLE_WOOD

      @NotNull public static final @NotNull XTag<XMaterial> NON_FLAMMABLE_WOOD
      Tag representing all non-flammable wood and bark variants
    • NON_WOODEN_STAIRS

      @NotNull public static final @NotNull XTag<XMaterial> NON_WOODEN_STAIRS
      Tag representing all non-wooden stairs
    • NON_WOODEN_SLABS

      @NotNull public static final @NotNull XTag<XMaterial> NON_WOODEN_SLABS
      Tag representing all non-wooden slabs
    • NYLIUM

      @NotNull public static final @NotNull XTag<XMaterial> NYLIUM
      Tag representing all nylium blocks
    • OAK_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> OAK_LOGS
      Tag representing all oak wood and bark variants
    • OCCLUDES_VIBRATION_SIGNALS

      @NotNull public static final @NotNull XTag<XMaterial> OCCLUDES_VIBRATION_SIGNALS
      Tag representing all possible blocks that can block vibration signals
    • ORES

      @NotNull public static final @NotNull XTag<XMaterial> ORES
      Tag representing all ores
    • PALE_OAK_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> PALE_OAK_LOGS
      Tag representing all pale oak log and bark variants
    • PARROTS_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> PARROTS_SPAWNABLE_ON
      Tag representing all possible block types parrots may spawn on
    • PIGLIN_FOOD

      @NotNull public static final @NotNull XTag<XMaterial> PIGLIN_FOOD
      Tag representing all items that can be used as piglin food
    • PIGLIN_REPELLENTS

      @NotNull public static final @NotNull XTag<XMaterial> PIGLIN_REPELLENTS
      Tag representing all block types that repel piglins
    • PLANKS

      @NotNull public static final @NotNull XTag<XMaterial> PLANKS
      Tag representing all types of planks
    • POLAR_BEARS_SPAWNABLE_ON_IN_FROZEN_OCEAN

      @NotNull public static final @NotNull XTag<XMaterial> POLAR_BEARS_SPAWNABLE_ON_IN_FROZEN_OCEAN
      Tag representing all possible blocks polar bears may spawn on
    • PORTALS

      @NotNull public static final @NotNull XTag<XMaterial> PORTALS
      Tag representing all possible block types that be used as portals
    • POTTERY_SHERDS

      @NotNull public static final @NotNull XTag<XMaterial> POTTERY_SHERDS
      Tag representing all possible pottery sherds
    • PRESSURE_PLATES

      @NotNull public static final @NotNull XTag<XMaterial> PRESSURE_PLATES
      Tag representing all possible variants of pressure plates
    • PREVENT_MOB_SPAWNING_INSIDE

      @NotNull public static final @NotNull XTag<XMaterial> PREVENT_MOB_SPAWNING_INSIDE
      Tag representing all block types that prevent inside mob spawning
    • RABBITS_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> RABBITS_SPAWNABLE_ON
      Tag representing all possible block types that rabbits may spawn on
    • RAILS

      @NotNull public static final @NotNull XTag<XMaterial> RAILS
      Tag representing all possible types of rails
    • REDSTONE_ORES

      @NotNull public static final @NotNull XTag<XMaterial> REDSTONE_ORES
      Tag representing all possible variants of redstone ores
    • REPLACEABLE_PLANTS

      @NotNull public static final @NotNull XTag<XMaterial> REPLACEABLE_PLANTS
      Tag representing all plant blocks that may be replaced
    • SAND

      @NotNull public static final @NotNull XTag<XMaterial> SAND
      Tag representing all possible types of sand
    • SAPLINGS

      @NotNull public static final @NotNull XTag<XMaterial> SAPLINGS
      Tag representing all possible types of saplings
    • SHULKER_BOXES

      @NotNull public static final @NotNull XTag<XMaterial> SHULKER_BOXES
      Tag representing all possible variants of shulker boxes
    • SIGNS

      @NotNull public static final @NotNull XTag<XMaterial> SIGNS
      Tag representing all possible variants of signs
    • SMALL_DRIPLEAF_PLACEABLE

      @NotNull public static final @NotNull XTag<XMaterial> SMALL_DRIPLEAF_PLACEABLE
      Tag representing all possible block types small dripleaf may be placed upon
    • SMALL_FLOWERS

      @NotNull public static final @NotNull XTag<XMaterial> SMALL_FLOWERS
      Tag representing all flowers small in size {1 block tall}
    • SMITHING_TEMPLATES

      @NotNull public static final @NotNull XTag<XMaterial> SMITHING_TEMPLATES
      Tag representing all possible smithing templates
    • SNOW

      @NotNull public static final @NotNull XTag<XMaterial> SNOW
      Tag representing all possible variants of snow
    • SOUL_FIRE_BASE_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> SOUL_FIRE_BASE_BLOCKS
      Tag representing all possible blocks that can be lit up with sould fire
    • SOUL_SPEED_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> SOUL_SPEED_BLOCKS
      Tag representing all possible blocks that activate soul speed enchantment
    • SPRUCE_LOGS

      @NotNull public static final @NotNull XTag<XMaterial> SPRUCE_LOGS
      Tag representing all spruce wood and log variants
    • STAIRS

      @NotNull public static final @NotNull XTag<XMaterial> STAIRS
      Tag representing all possible types of stairs
    • STANDING_SIGNS

      @NotNull public static final @NotNull XTag<XMaterial> STANDING_SIGNS
      Tag representing all possible types of standing signs
    • STONE_BRICKS

      @NotNull public static final @NotNull XTag<XMaterial> STONE_BRICKS
      Tag representing all possible variants of stone bricks
    • STONE_ORE_REPLACEABLES

      @NotNull public static final @NotNull XTag<XMaterial> STONE_ORE_REPLACEABLES
      Tag representing all possible blocks that can be replaced by regular stone ores
    • STONE_PRESSURE_PLATES

      @NotNull public static final @NotNull XTag<XMaterial> STONE_PRESSURE_PLATES
      Tag representing all pressure plates made of some type of stone
    • STRIDER_WARM_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> STRIDER_WARM_BLOCKS
      Tag representing all block types that make strider warm
    • TALL_FLOWERS

      @NotNull public static final @NotNull XTag<XMaterial> TALL_FLOWERS
      Tag representing all flowers that are tall {2 blocks}
    • TERRACOTTA

      @NotNull public static final @NotNull XTag<XMaterial> TERRACOTTA
      Tag representing all possible variants of non-glazed terracotta
    • TRAPDOORS

      @NotNull public static final @NotNull XTag<XMaterial> TRAPDOORS
      Tag representing all possible types of trapdoors
    • UNDERWATER_BONEMEALS

      @NotNull public static final @NotNull XTag<XMaterial> UNDERWATER_BONEMEALS
      Tag representing all block types that can be bonemealed underwater
    • UNSTABLE_BOTTOM_CENTER

      @NotNull public static final @NotNull XTag<XMaterial> UNSTABLE_BOTTOM_CENTER
      Tag representing all blocks that have unstable bottom when placed in centre of 2 blocks
    • VALID_SPAWN

      @NotNull public static final @NotNull XTag<XMaterial> VALID_SPAWN
      Tag representing all valid mob spawn positions
    • WALL_HANGING_SIGNS

      @NotNull public static final @NotNull XTag<XMaterial> WALL_HANGING_SIGNS
      Tag representing all possible variants of wall hanging sign
    • WALL_POST_OVERRIDE

      @NotNull public static final @NotNull XTag<XMaterial> WALL_POST_OVERRIDE
      Tag representing all possible block types that can override a wall post creation
    • WALL_SIGNS

      @NotNull public static final @NotNull XTag<XMaterial> WALL_SIGNS
      Tag representing all wall signs
    • WALL_TORCHES

      @NotNull public static final @NotNull XTag<XMaterial> WALL_TORCHES
      Tag representing all possible types of wall torches
    • WALLS

      @NotNull public static final @NotNull XTag<XMaterial> WALLS
      Tag representing all different types of walls
    • WARPED_STEMS

      @NotNull public static final @NotNull XTag<XMaterial> WARPED_STEMS
      Tag representing all warped stems
    • WITHER_IMMUNE

      @NotNull public static final @NotNull XTag<XMaterial> WITHER_IMMUNE
      Tag representing all block types that can't be destroyed by withers
    • WITHER_SUMMON_BASE_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> WITHER_SUMMON_BASE_BLOCKS
      Tag representing all possible block types that may be used as wither summon base
    • WOLVES_SPAWNABLE_ON

      @NotNull public static final @NotNull XTag<XMaterial> WOLVES_SPAWNABLE_ON
      Tag representing all possible block types that wolves may spawn on
    • WOODEN_BUTTONS

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_BUTTONS
      Tag representing all possible types of wooden buttons
    • WOODEN_DOORS

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_DOORS
      Tag representing all possible types of wooden doors
    • WOODEN_FENCE_GATES

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_FENCE_GATES
      Tag representing all possible types of wooden fence gates
    • WOODEN_FENCES

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_FENCES
      Tag representing all possible types of wooden fences
    • WOODEN_PRESSURE_PLATES

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_PRESSURE_PLATES
      Tag representing all possible types of wooden pressure plates
    • WOODEN_SLABS

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_SLABS
      Tag representing all possible types of wooden slabs
    • WOODEN_STAIRS

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_STAIRS
      Tag representing all possible types of wooden stairs
    • WOODEN_TRAPDOORS

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_TRAPDOORS
      Tag representing all possible types of wooden trapdoors
    • WOOL

      @NotNull public static final @NotNull XTag<XMaterial> WOOL
      Tag representing all possible types of wool
    • LEATHER_ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> LEATHER_ARMOR_PIECES
      Tag representing all armor pieces made of leather
    • IRON_ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> IRON_ARMOR_PIECES
      Tag representing all armor pieces made of iron
    • CHAINMAIL_ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> CHAINMAIL_ARMOR_PIECES
      Tag representing all armor pieces made of chains
    • GOLDEN_ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> GOLDEN_ARMOR_PIECES
      Tag representing all armor pieces made of gold
    • DIAMOND_ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> DIAMOND_ARMOR_PIECES
      Tag representing all armor pieces made of diamond
    • NETHERITE_ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> NETHERITE_ARMOR_PIECES
      Tag representing all armor pieces made of netherite
    • ARMOR_PIECES

      @NotNull public static final @NotNull XTag<XMaterial> ARMOR_PIECES
      Tag representing all armor pieces that add armor bars upon wearing
    • WOODEN_TOOLS

      @NotNull public static final @NotNull XTag<XMaterial> WOODEN_TOOLS
      Tag representing all wooden tools and swords
    • FLUID

      @NotNull public static final @NotNull XTag<XMaterial> FLUID
      This doesn't refer to all materials that contain fluids, but pure fluids.
    • STONE_TOOLS

      @NotNull public static final @NotNull XTag<XMaterial> STONE_TOOLS
      Tag representing all stone tools and swords
    • IRON_TOOLS

      @NotNull public static final @NotNull XTag<XMaterial> IRON_TOOLS
      Tag representing all iron tools and swords
    • DIAMOND_TOOLS

      @NotNull public static final @NotNull XTag<XMaterial> DIAMOND_TOOLS
      Tag representing all diamond tools and swords
    • NETHERITE_TOOLS

      @NotNull public static final @NotNull XTag<XMaterial> NETHERITE_TOOLS
      Tag representing all netherite tools and swords
    • DANGEROUS_BLOCKS

      @NotNull public static final @NotNull XTag<XMaterial> DANGEROUS_BLOCKS
      Tag representing all blocks that could harm a player.
    • ARMOR_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> ARMOR_ENCHANTS
      Tag representing all possible enchants that can be applied to all armor pieces (excluding elytras)
    • HELEMT_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> HELEMT_ENCHANTS
      Tag representing all possible enchants that can be applied to helmets/turtle shells
    • CHESTPLATE_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> CHESTPLATE_ENCHANTS
      Tag representing all possible enchants that can be applied to chestplates
    • LEGGINGS_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> LEGGINGS_ENCHANTS
      Tag representing all possible enchants that can be applied to leggings
    • BOOTS_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> BOOTS_ENCHANTS
      Tag representing all possible enchants that can be applied to boots
    • ELYTRA_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> ELYTRA_ENCHANTS
      Tag representing all possible enchants that can be applied to elytras
    • SWORD_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> SWORD_ENCHANTS
      Tag representing all possible enchants that can be applied to swords
    • AXE_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> AXE_ENCHANTS
      Tag representing all possible enchants that can be applied to axes
    • HOE_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> HOE_ENCHANTS
      Tag representing all possible enchants that can be applied to hoes
    • PICKAXE_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> PICKAXE_ENCHANTS
      Tag representing all possible enchants that can be applied to pickaxes
    • SHOVEL_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> SHOVEL_ENCHANTS
      Tag representing all possible enchants that can be applied to shovels
    • SHEARS_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> SHEARS_ENCHANTS
      Tag representing all possible enchants that can be applied to shears
    • BOW_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> BOW_ENCHANTS
      Tag representing all possible enchants that can be applied to bows
    • CROSSBOW_ENCHANTS

      @NotNull public static final @NotNull XTag<XEnchantment> CROSSBOW_ENCHANTS
      Tag representing all possible enchants that can be applied to crossbows
    • EFFECTIVE_SMITE_ENTITIES

      @NotNull public static final @NotNull XTag<XEntityType> EFFECTIVE_SMITE_ENTITIES
      Entity types that XEnchantment.SMITE enchantment is effective against. This set is unmodifiable.
      Since:
      1.2.0
    • EFFECTIVE_BANE_OF_ARTHROPODS_ENTITIES

      @NotNull public static final @NotNull XTag<XEntityType> EFFECTIVE_BANE_OF_ARTHROPODS_ENTITIES
      Entity types that XEnchantment.BANE_OF_ARTHROPODS enchantment is effective against. This set is unmodifiable.
      Since:
      1.2.0
    • DEBUFFS

      @NotNull public static final @NotNull XTag<XPotion> DEBUFFS
      An unmodifiable set of "bad" potion effects.
      Since:
      1.1.0
    • MATERIAL_TO_ENTITY

      public static final Map<XMaterial,XEntityType> MATERIAL_TO_ENTITY
      What entity spawns when a material is placed down? Mostly for things that spawn instantly after a single right-click whether it requires a block or free air.

      It doesn't work for bows and arrows, TNT, fishing bobs or EXP bottles.

  • Method Details

    • stringMatcher

      public static <E> List<XTag.Matcher<E>> stringMatcher(@Nullable @Nullable Collection<String> elements)
    • stringMatcher

      public static <E> List<XTag.Matcher<E>> stringMatcher(@Nullable @Nullable Collection<String> elements, @Nullable @Nullable Collection<XTag.Matcher.Error> errors)
      Compiles a list of string checkers for various classes like XMaterial, XSound, etc. Mostly used for configs.

      Supports String.contains(java.lang.CharSequence) CONTAINS:NAME and Regular Expression REGEX:PATTERN formats.

      Example:

           XMaterial material = XMaterial.matchXMaterial(ItemStack);
           if (XTag.anyMatch(XTag.stringMatcher(plugin.getConfig().getStringList("disabled-items"), null)) return;
       

      CONTAINS Examples:
           "CONTAINS:CHEST" -> CHEST, ENDERCHEST, TRAPPED_CHEST -> true
           "cOnTaINS:dYe" -> GREEN_DYE, YELLOW_DYE, BLUE_DYE, INK_SACK -> true
       

      REGEX Examples

           "REGEX:^.+_.+_.+$" -> Every Material with 3 underlines or more: SHULKER_SPAWN_EGG, SILVERFISH_SPAWN_EGG, SKELETON_HORSE_SPAWN_EGG
           "REGEX:^.{1,3}$" -> Material names that have 3 letters only: BED, MAP, AIR
       

      The reason that there are tags for CONTAINS and REGEX is for the performance. Server owners should be advised to avoid using REGEX tag if they can use the CONTAINS tag instead.

      Want to learn RegEx? You can mess around in RegExr website.

      Parameters:
      elements - the material names to check base material on.
      Returns:
      a compiled list of enum matchers.
    • anyMatchString

      public static <T> boolean anyMatchString(T target, Collection<String> matchers)
    • anyMatch

      public static <T> boolean anyMatch(T target, Collection<XTag.Matcher<T>> matchers)
    • isItem

      public static boolean isItem(XMaterial material)
      Checks if this Material is an obtainable item. "Obtainable items" are simply materials that can be displayed in your GUI. This method is mainly designed to support pre-1.13, servers using 1.13 and above will directly have their materials checked with Material.isItem()
      Returns:
      true if this material is an item, otherwise false if it's not an item or the item is not supported.
      Since:
      1.13
    • isInteractable

      public static boolean isInteractable(XMaterial material)
      Checks if this Material can be interacted with.

      Interactable materials include those with functionality when they are interacted with by a player such as chests, furnaces, etc.

      Some blocks such as piston heads and stairs are considered interactable though may not perform any additional functionality.

      Note that the interactability of some materials may be dependent on their state as well. This method will return true if there is at least one state in which additional interact handling is performed for the material.

      Returns:
      true if this material can be interacted with.
      Since:
      1.13
    • getValues

      @NotNull public @NotNull Set<T> getValues()
      Returns:
      Set of all the values represented by the tag
    • isTagged

      public boolean isTagged(@Nullable T value)
    • getTag

      public static Optional<XTag<?>> getTag(String name)