Enum Class WorldFlag
- All Implemented Interfaces:
Serializable, Comparable<WorldFlag>, Constable
Enum representing world flags that control world-level mechanics within a region.
World flags govern environmental and entity behavior such as mob spawning, fire spread, liquid flow, explosions, and other world mechanics. These flags are applied at the region level and affect all players and entities within the region boundaries. Each flag is represented as a unique bit in a 64-bit integer.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.Allows entities to take damage from environmental sources in the region.Allows entities to grief blocks (e.g., creeper explosions, enderman picking up blocks).Allows explosions to damage blocks in the region.Allows fire to spread to adjacent flammable blocks.Allows grass and mycelium to spread to dirt blocks.Allows hostile entities (mobs, monsters) to spawn naturally in the region.Allows ice to melt near light sources.Allows leaves to decay naturally when their logs are removed.Allows liquids (water, lava) to flow naturally.Allows passive entities (animals, villagers) to spawn naturally in the region.Allows plants (crops, saplings) to grow naturally.Makes players in the region glow (visible through walls).Allows projectiles (arrows, fireballs, etc.) to damage blocks or entities in the region.Allows sculk blocks to spread in the region.Allows snow layers to melt near light sources.Allows snowmen to leave snow trails as they move.Allows war mechanics (region vs region combat) in the region.Allows snow weather in the region.Allows dispensers to function in wilderness areas.Allows minecarts to function in wilderness areas.Allows pistons to function in wilderness areas.Allows wind charge burst effects in the region.Allows the Wither boss to damage blocks in the region. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringfrom(long flag) Returns the config name of a flag given its bitmask value.longReturns the bitmask value of this flag.getFlags()Returns a sorted list of all world flag config names.getName()Returns the configuration name of this flag (lowercase with hyphens).getSet(long flags) Returns a list of flag names that are set (enabled) in the given bitmask.getUnset(long flags) Returns a list of flag names that are not set (disabled) in the given bitmask.static longParses a flag name and returns its bitmask value.static WorldFlagReturns the enum constant of this class with the specified name.static WorldFlag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PASSIVE_ENTITY_SPAWN
Allows passive entities (animals, villagers) to spawn naturally in the region. -
HOSTILE_ENTITY_SPAWN
Allows hostile entities (mobs, monsters) to spawn naturally in the region. -
ENTITY_GRIEFING
Allows entities to grief blocks (e.g., creeper explosions, enderman picking up blocks). -
ENTITY_DAMAGE
Allows entities to take damage from environmental sources in the region. -
LEAVES_DECAY
Allows leaves to decay naturally when their logs are removed. -
FIRE_SPREAD
Allows fire to spread to adjacent flammable blocks. -
LIQUID_FLOW
Allows liquids (water, lava) to flow naturally. -
EXPLOSION_DAMAGE
Allows explosions to damage blocks in the region. -
WITHER_DAMAGE
Allows the Wither boss to damage blocks in the region. -
WILDERNESS_PISTONS
Allows pistons to function in wilderness areas. -
WILDERNESS_DISPENSERS
Allows dispensers to function in wilderness areas. -
WILDERNESS_MINECARTS
Allows minecarts to function in wilderness areas. -
PLANT_GROWTH
Allows plants (crops, saplings) to grow naturally. -
GRASS_GROWTH
Allows grass and mycelium to spread to dirt blocks. -
SCULK_SPREAD
Allows sculk blocks to spread in the region. -
PLAYER_GLOWING
Makes players in the region glow (visible through walls). -
SNOW_MELTING
Allows snow layers to melt near light sources. -
ICE_MELTING
Allows ice to melt near light sources. -
SNOWMAN_TRAILS
Allows snowmen to leave snow trails as they move. -
WINDCHARGE_BURST
Allows wind charge burst effects in the region. -
COPPER_GOLEMS_INTERACTION
Deprecated.UseENTITY_GRIEFINGinstead.Allows copper golems to interact. -
WARS
Allows war mechanics (region vs region combat) in the region. -
PROJECTILES
Allows projectiles (arrows, fireballs, etc.) to damage blocks or entities in the region. -
WEATHER_SNOW
Allows snow weather in the region.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getFlags
-
parse
Parses a flag name and returns its bitmask value.- Parameters:
name- the config name of the flag (case-insensitive)- Returns:
- the bitmask value, or 0 if not found
-
from
Returns the config name of a flag given its bitmask value.- Parameters:
flag- the bitmask value- Returns:
- the config name, or null if not found
-
getSet
-
getUnset
-
getBitmask
public long getBitmask()Returns the bitmask value of this flag.- Returns:
- the bitmask as a long value
-
getName
Returns the configuration name of this flag (lowercase with hyphens).- Returns:
- the config name
-
ENTITY_GRIEFINGinstead.