Package org.bukkit
Enum Material
java.lang.Object
java.lang.Enum<Material>
org.bukkit.Material
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Material>
,java.lang.constant.Constable
public enum Material extends java.lang.Enum<Material>
An enum of all material IDs accepted by the official server and client
-
Nested Class Summary
-
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description java.lang.Class<? extends MaterialData>
getData()
Gets the MaterialData class associated with this Materialint
getId()
Deprecated.Magic valuestatic Material
getMaterial(int id)
Deprecated.Magic valuestatic Material
getMaterial(java.lang.String name)
Attempts to get the Material with the given name.short
getMaxDurability()
Gets the maximum durability of this materialint
getMaxStackSize()
Gets the maximum amount of this material that can be held in a stackMaterialData
getNewData(byte raw)
Deprecated.Magic valueboolean
hasGravity()
boolean
isBlock()
Checks if this Material is a placable blockboolean
isBurnable()
Check if the material is a block and can burn awayboolean
isEdible()
Checks if this Material is edible.boolean
isFlammable()
Check if the material is a block and can catch fireboolean
isOccluding()
Check if the material is a block and completely blocks visionboolean
isRecord()
boolean
isSolid()
Check if the material is a block and solid (cannot be passed through by a player)boolean
isTransparent()
Check if the material is a block and does not block any lightstatic Material
matchMaterial(java.lang.String name)
Attempts to match the Material with the given name.static Material
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Material[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
AIR
-
STONE
-
GRASS
-
DIRT
-
COBBLESTONE
-
WOOD
-
SAPLING
-
BEDROCK
-
WATER
-
STATIONARY_WATER
-
LAVA
-
STATIONARY_LAVA
-
SAND
-
GRAVEL
-
GOLD_ORE
-
IRON_ORE
-
COAL_ORE
-
LOG
-
LEAVES
-
SPONGE
-
GLASS
-
LAPIS_ORE
-
LAPIS_BLOCK
-
DISPENSER
-
SANDSTONE
-
NOTE_BLOCK
-
BED_BLOCK
-
POWERED_RAIL
-
DETECTOR_RAIL
-
PISTON_STICKY_BASE
-
WEB
-
LONG_GRASS
-
DEAD_BUSH
-
PISTON_BASE
-
PISTON_EXTENSION
-
WOOL
-
PISTON_MOVING_PIECE
-
YELLOW_FLOWER
-
RED_ROSE
-
BROWN_MUSHROOM
-
RED_MUSHROOM
-
GOLD_BLOCK
-
IRON_BLOCK
-
DOUBLE_STEP
-
STEP
-
BRICK
-
TNT
-
BOOKSHELF
-
MOSSY_COBBLESTONE
-
OBSIDIAN
-
TORCH
-
FIRE
-
MOB_SPAWNER
-
WOOD_STAIRS
-
CHEST
-
REDSTONE_WIRE
-
DIAMOND_ORE
-
DIAMOND_BLOCK
-
WORKBENCH
-
CROPS
-
SOIL
-
FURNACE
-
BURNING_FURNACE
-
SIGN_POST
-
WOODEN_DOOR
-
LADDER
-
RAILS
-
COBBLESTONE_STAIRS
-
WALL_SIGN
-
LEVER
-
STONE_PLATE
-
IRON_DOOR_BLOCK
-
WOOD_PLATE
-
REDSTONE_ORE
-
GLOWING_REDSTONE_ORE
-
REDSTONE_TORCH_OFF
-
REDSTONE_TORCH_ON
-
STONE_BUTTON
-
SNOW
-
ICE
-
SNOW_BLOCK
-
CACTUS
-
CLAY
-
SUGAR_CANE_BLOCK
-
JUKEBOX
-
FENCE
-
PUMPKIN
-
NETHERRACK
-
SOUL_SAND
-
GLOWSTONE
-
PORTAL
-
JACK_O_LANTERN
-
CAKE_BLOCK
-
DIODE_BLOCK_OFF
-
DIODE_BLOCK_ON
-
STAINED_GLASS
-
TRAP_DOOR
-
MONSTER_EGGS
-
SMOOTH_BRICK
-
HUGE_MUSHROOM_1
-
HUGE_MUSHROOM_2
-
IRON_FENCE
-
THIN_GLASS
-
MELON_BLOCK
-
PUMPKIN_STEM
-
MELON_STEM
-
VINE
-
FENCE_GATE
-
BRICK_STAIRS
-
SMOOTH_STAIRS
-
MYCEL
-
WATER_LILY
-
NETHER_BRICK
-
NETHER_FENCE
-
NETHER_BRICK_STAIRS
-
NETHER_WARTS
-
ENCHANTMENT_TABLE
-
BREWING_STAND
-
CAULDRON
-
ENDER_PORTAL
-
ENDER_PORTAL_FRAME
-
ENDER_STONE
-
DRAGON_EGG
-
REDSTONE_LAMP_OFF
-
REDSTONE_LAMP_ON
-
WOOD_DOUBLE_STEP
-
WOOD_STEP
-
COCOA
-
SANDSTONE_STAIRS
-
EMERALD_ORE
-
ENDER_CHEST
-
TRIPWIRE_HOOK
-
TRIPWIRE
-
EMERALD_BLOCK
-
SPRUCE_WOOD_STAIRS
-
BIRCH_WOOD_STAIRS
-
JUNGLE_WOOD_STAIRS
-
COMMAND
-
BEACON
-
COBBLE_WALL
-
FLOWER_POT
-
CARROT
-
POTATO
-
WOOD_BUTTON
-
SKULL
-
ANVIL
-
TRAPPED_CHEST
-
GOLD_PLATE
-
IRON_PLATE
-
REDSTONE_COMPARATOR_OFF
-
REDSTONE_COMPARATOR_ON
-
DAYLIGHT_DETECTOR
-
REDSTONE_BLOCK
-
QUARTZ_ORE
-
HOPPER
-
QUARTZ_BLOCK
-
QUARTZ_STAIRS
-
ACTIVATOR_RAIL
-
DROPPER
-
STAINED_CLAY
-
STAINED_GLASS_PANE
-
LEAVES_2
-
LOG_2
-
ACACIA_STAIRS
-
DARK_OAK_STAIRS
-
SLIME_BLOCK
-
BARRIER
-
IRON_TRAPDOOR
-
PRISMARINE
-
SEA_LANTERN
-
HAY_BLOCK
-
CARPET
-
HARD_CLAY
-
COAL_BLOCK
-
PACKED_ICE
-
DOUBLE_PLANT
-
STANDING_BANNER
-
WALL_BANNER
-
DAYLIGHT_DETECTOR_INVERTED
-
RED_SANDSTONE
-
RED_SANDSTONE_STAIRS
-
DOUBLE_STONE_SLAB2
-
STONE_SLAB2
-
SPRUCE_FENCE_GATE
-
BIRCH_FENCE_GATE
-
JUNGLE_FENCE_GATE
-
DARK_OAK_FENCE_GATE
-
ACACIA_FENCE_GATE
-
SPRUCE_FENCE
-
BIRCH_FENCE
-
JUNGLE_FENCE
-
DARK_OAK_FENCE
-
ACACIA_FENCE
-
SPRUCE_DOOR
-
BIRCH_DOOR
-
JUNGLE_DOOR
-
ACACIA_DOOR
-
DARK_OAK_DOOR
-
IRON_SPADE
-
IRON_PICKAXE
-
IRON_AXE
-
FLINT_AND_STEEL
-
APPLE
-
BOW
-
ARROW
-
COAL
-
DIAMOND
-
IRON_INGOT
-
GOLD_INGOT
-
IRON_SWORD
-
WOOD_SWORD
-
WOOD_SPADE
-
WOOD_PICKAXE
-
WOOD_AXE
-
STONE_SWORD
-
STONE_SPADE
-
STONE_PICKAXE
-
STONE_AXE
-
DIAMOND_SWORD
-
DIAMOND_SPADE
-
DIAMOND_PICKAXE
-
DIAMOND_AXE
-
STICK
-
BOWL
-
MUSHROOM_SOUP
-
GOLD_SWORD
-
GOLD_SPADE
-
GOLD_PICKAXE
-
GOLD_AXE
-
STRING
-
FEATHER
-
SULPHUR
-
WOOD_HOE
-
STONE_HOE
-
IRON_HOE
-
DIAMOND_HOE
-
GOLD_HOE
-
SEEDS
-
WHEAT
-
BREAD
-
LEATHER_HELMET
-
LEATHER_CHESTPLATE
-
LEATHER_LEGGINGS
-
LEATHER_BOOTS
-
CHAINMAIL_HELMET
-
CHAINMAIL_CHESTPLATE
-
CHAINMAIL_LEGGINGS
-
CHAINMAIL_BOOTS
-
IRON_HELMET
-
IRON_CHESTPLATE
-
IRON_LEGGINGS
-
IRON_BOOTS
-
DIAMOND_HELMET
-
DIAMOND_CHESTPLATE
-
DIAMOND_LEGGINGS
-
DIAMOND_BOOTS
-
GOLD_HELMET
-
GOLD_CHESTPLATE
-
GOLD_LEGGINGS
-
GOLD_BOOTS
-
FLINT
-
PORK
-
GRILLED_PORK
-
PAINTING
-
GOLDEN_APPLE
-
SIGN
-
WOOD_DOOR
-
BUCKET
-
WATER_BUCKET
-
LAVA_BUCKET
-
MINECART
-
SADDLE
-
IRON_DOOR
-
REDSTONE
-
SNOW_BALL
-
BOAT
-
LEATHER
-
MILK_BUCKET
-
CLAY_BRICK
-
CLAY_BALL
-
SUGAR_CANE
-
PAPER
-
BOOK
-
SLIME_BALL
-
STORAGE_MINECART
-
POWERED_MINECART
-
EGG
-
COMPASS
-
FISHING_ROD
-
WATCH
-
GLOWSTONE_DUST
-
RAW_FISH
-
COOKED_FISH
-
INK_SACK
-
BONE
-
SUGAR
-
CAKE
-
BED
-
DIODE
-
COOKIE
-
MAP
- See Also:
MapView
-
SHEARS
-
MELON
-
PUMPKIN_SEEDS
-
MELON_SEEDS
-
RAW_BEEF
-
COOKED_BEEF
-
RAW_CHICKEN
-
COOKED_CHICKEN
-
ROTTEN_FLESH
-
ENDER_PEARL
-
BLAZE_ROD
-
GHAST_TEAR
-
GOLD_NUGGET
-
NETHER_STALK
-
POTION
- See Also:
Potion
-
GLASS_BOTTLE
-
SPIDER_EYE
-
FERMENTED_SPIDER_EYE
-
BLAZE_POWDER
-
MAGMA_CREAM
-
BREWING_STAND_ITEM
-
CAULDRON_ITEM
-
EYE_OF_ENDER
-
SPECKLED_MELON
-
MONSTER_EGG
-
EXP_BOTTLE
-
FIREBALL
-
BOOK_AND_QUILL
-
WRITTEN_BOOK
-
EMERALD
-
ITEM_FRAME
-
FLOWER_POT_ITEM
-
CARROT_ITEM
-
POTATO_ITEM
-
BAKED_POTATO
-
POISONOUS_POTATO
-
EMPTY_MAP
-
GOLDEN_CARROT
-
SKULL_ITEM
-
CARROT_STICK
-
NETHER_STAR
-
PUMPKIN_PIE
-
FIREWORK
-
FIREWORK_CHARGE
-
ENCHANTED_BOOK
-
REDSTONE_COMPARATOR
-
NETHER_BRICK_ITEM
-
QUARTZ
-
EXPLOSIVE_MINECART
-
HOPPER_MINECART
-
PRISMARINE_SHARD
-
PRISMARINE_CRYSTALS
-
RABBIT
-
COOKED_RABBIT
-
RABBIT_STEW
-
RABBIT_FOOT
-
RABBIT_HIDE
-
ARMOR_STAND
-
IRON_BARDING
-
GOLD_BARDING
-
DIAMOND_BARDING
-
LEASH
-
NAME_TAG
-
COMMAND_MINECART
-
MUTTON
-
COOKED_MUTTON
-
BANNER
-
SPRUCE_DOOR_ITEM
-
BIRCH_DOOR_ITEM
-
JUNGLE_DOOR_ITEM
-
ACACIA_DOOR_ITEM
-
DARK_OAK_DOOR_ITEM
-
GOLD_RECORD
-
GREEN_RECORD
-
RECORD_3
-
RECORD_4
-
RECORD_5
-
RECORD_6
-
RECORD_7
-
RECORD_8
-
RECORD_9
-
RECORD_10
-
RECORD_11
-
RECORD_12
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getId
@Deprecated public int getId()Deprecated.Magic valueGets the item ID or block ID of this Material- Returns:
- ID of this material
-
getMaxStackSize
public int getMaxStackSize()Gets the maximum amount of this material that can be held in a stack- Returns:
- Maximum stack size for this material
-
getMaxDurability
public short getMaxDurability()Gets the maximum durability of this material- Returns:
- Maximum durability for this material
-
getData
Gets the MaterialData class associated with this Material- Returns:
- MaterialData associated with this Material
-
getNewData
Deprecated.Magic valueConstructs a new MaterialData relevant for this Material, with the given initial data- Parameters:
raw
- Initial data to construct the MaterialData with- Returns:
- New MaterialData with the given data
-
isBlock
public boolean isBlock()Checks if this Material is a placable block- Returns:
- true if this material is a block
-
isEdible
public boolean isEdible()Checks if this Material is edible.- Returns:
- true if this Material is edible.
-
getMaterial
Deprecated.Magic valueAttempts to get the Material with the given ID- Parameters:
id
- ID of the material to get- Returns:
- Material if found, or null
-
getMaterial
Attempts to get the Material with the given name.This is a normal lookup, names must be the precise name they are given in the enum.
- Parameters:
name
- Name of the material to get- Returns:
- Material if found, or null
-
matchMaterial
Attempts to match the Material with the given name.This is a match lookup; names will be converted to uppercase, then stripped of special characters in an attempt to format it like the enum.
Using this for match by ID is deprecated.
- Parameters:
name
- Name of the material to get- Returns:
- Material if found, or null
-
isRecord
public boolean isRecord()- Returns:
- True if this material represents a playable music disk.
-
isSolid
public boolean isSolid()Check if the material is a block and solid (cannot be passed through by a player)- Returns:
- True if this material is a block and solid
-
isTransparent
public boolean isTransparent()Check if the material is a block and does not block any light- Returns:
- True if this material is a block and does not block any light
-
isFlammable
public boolean isFlammable()Check if the material is a block and can catch fire- Returns:
- True if this material is a block and can catch fire
-
isBurnable
public boolean isBurnable()Check if the material is a block and can burn away- Returns:
- True if this material is a block and can burn away
-
isOccluding
public boolean isOccluding()Check if the material is a block and completely blocks vision- Returns:
- True if this material is a block and completely blocks vision
-
hasGravity
public boolean hasGravity()- Returns:
- True if this material is affected by gravity.
-