Enum Class PlayerFlag
- All Implemented Interfaces:
Serializable, Comparable<PlayerFlag>, Constable
Enum representing player flags that control individual player permissions within a region.
Player flags govern what actions a specific player can perform in a region, such as breaking/placing blocks, using containers, interacting with entities, PvP combat, and various other gameplay mechanics. These flags are typically assigned per-member or for everyone within a region. 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 ConstantDescriptionAllows interacting with armor stands.Prevents trampling farmland when walking/jumping on it.Allows breaking blocks in the region.Allows pressing buttons.Allows opening and accessing containers (chests, furnaces, barrels, etc.).Allows damaging hostile entities (mobs, monsters).Allows damaging passive entities (animals, villagers).Allows opening and closing wooden doors.Allows using elytra for gliding in the region.Allows opening and closing fence gates.Allows Frost Walker enchantment to create ice on water.Allows general interaction with blocks.Allows harvesting fully grown crops.Allows igniting blocks.Allows interacting with entities.Allows interacting with item frames and glow item frames.Allows using levers.Allows passing through region borders without permission checks.Allows picking up items from the ground in the region.Allows placing blocks in the region.Allows activating pressure plates.Deprecated.Due to heavy main-thread CPU overhead from constant raycasting and high vulnerability to client-side bypasses.Allows PvP combat with other players in the region.Allows interacting with redstone components, excluding buttons, levers, and pressure plates.Allows sleeping in beds in the region.Allows spawning entities in the region.Allows taking fall damage in the region.Allows teleporting in the region.Allows teleporting to the region's spawn point.Allows throwing eggs.Allows throwing splash/lingering potions in the region.Allows trading with villagers.Allows opening and closing trapdoors.Allows triggering raid events in the region.Allows triggering tripwire hooks.Allows using anvils for repairing and renaming items.Allows ringing bells.Allows entering and controlling vehicles (boats, minecarts, horses). -
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 player 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 PlayerFlagReturns the enum constant of this class with the specified name.static PlayerFlag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BREAK_BLOCKS
Allows breaking blocks in the region. -
PLACE_BLOCKS
Allows placing blocks in the region. -
CONTAINERS
Allows opening and accessing containers (chests, furnaces, barrels, etc.). -
DOORS
Allows opening and closing wooden doors. -
TRAP_DOORS
Allows opening and closing trapdoors. -
FENCE_GATES
Allows opening and closing fence gates. -
USE_ANVIL
Allows using anvils for repairing and renaming items. -
REDSTONE
Allows interacting with redstone components, excluding buttons, levers, and pressure plates. -
LEVERS
Allows using levers. -
BUTTONS
Allows pressing buttons. -
PRESSURE_PLATES
Allows activating pressure plates. -
USE_BELLS
Allows ringing bells. -
TRIGGER_TRIPWIRE
Allows triggering tripwire hooks. -
FROST_WALKER
Allows Frost Walker enchantment to create ice on water. -
HARVEST_CROPS
Allows harvesting fully grown crops. -
BLOCK_TRAMPLING
Prevents trampling farmland when walking/jumping on it. -
GENERAL_INTERACTION
Allows general interaction with blocks. -
ARMOR_STANDS
Allows interacting with armor stands. -
INTERACT_ENTITIES
Allows interacting with entities. -
ITEM_FRAME_INTERACTION
Allows interacting with item frames and glow item frames. -
DAMAGE_PASSIVE_ENTITIES
Allows damaging passive entities (animals, villagers). -
DAMAGE_HOSTILE_ENTITIES
Allows damaging hostile entities (mobs, monsters). -
TRADE_VILLAGERS
Allows trading with villagers. -
IGNITE
Allows igniting blocks. -
VEHICLES
Allows entering and controlling vehicles (boats, minecarts, horses). -
TELEPORT_SPAWN
Allows teleporting to the region's spawn point. -
PASSTHROUGH
Allows passing through region borders without permission checks. -
PVP
Allows PvP combat with other players in the region. -
TAKE_FALL_DAMAGE
Allows taking fall damage in the region. -
TELEPORT
Allows teleporting in the region. -
THROW_POTIONS
Allows throwing splash/lingering potions in the region. -
PICKUP_ITEMS
Allows picking up items from the ground in the region. -
SLEEP
Allows sleeping in beds in the region. -
TRIGGER_RAID
Allows triggering raid events in the region. -
ELYTRA
Allows using elytra for gliding in the region. -
SPAWN_ENTITIES
Allows spawning entities in the region. -
PUNCH_SULFUR_CUBES
Deprecated.Due to heavy main-thread CPU overhead from constant raycasting and high vulnerability to client-side bypasses. UseINTERACT_ENTITIESinstead.Allows punching sulfur cubes (custom gameplay mechanic). -
THROW_EGGS
Allows throwing eggs.
-
-
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
-