9.3. Built-in Types
Quick reference for built-in type constructors and methods. For operator compatibility, see Operator Reference.
9.3.1. Primitives
9.3.1.1. String
Represents plain text.
Default value: "" (empty string)
Literal: Any text in double quotes (e.g., "Hello, world!")
Constructor |
Description |
|---|---|
|
Get player name (e.g., |
|
Convert Long to text ( |
|
Convert Float to text ( |
|
Convert Int to text ( |
|
Convert Double to text ( |
|
Convert Boolean to text ( |
|
Get entity description (Paper magic value, not meaningful). |
|
Get item description (Paper magic value, not meaningful).. |
|
Get block description (Paper magic value, not meaningful). |
|
Clone a String. |
Method |
Return Type |
Description |
|---|---|---|
|
Boolean |
True if String contains sequence, false otherwise. |
|
Boolean |
Case-insensitive equality check. |
|
Int |
Index of first occurrence, or -1 if not found. |
|
Int |
Number of characters in the String. |
|
Boolean |
True if String matches regex pattern, false otherwise. |
|
String |
Replace all occurrences of old with replacement. |
|
String[] |
Split into a list by delimiter. |
|
Boolean |
True if String starts with start, false otherwise. |
|
String |
Returns the String itself. |
|
String |
Substring from start (inclusive) to end (exclusive). |
|
String |
Convert all letters to lowercase. |
|
String |
Convert all letters to uppercase. |
|
String |
Remove leading/trailing whitespace. |
9.3.1.2. Int
Represents whole numbers in the range -2,147,483,648 to 2,147,483,647 inclusive.
Default value: 0
Literal: Any whole number in the range (42, -7, 0)
Constructor |
Description |
|---|---|
|
Cast Long to Int (causes problems if your Long value is outside the Int range). |
|
Discard decimals (truncate towards zero, not round). |
|
Clone an Int. |
|
Discard decimals (truncate towards zero, not round). |
|
Parse String to Int. Throws NumberFormatException if invalid. |
Method |
Return Type |
Description |
|---|---|---|
|
String |
Returns the String representation of this Int. |
9.3.1.3. Long
Represents large whole numbers in the range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 inclusive.
Default value: 0
Literal: Number with L suffix (42L, -7L)
Constructor |
Description |
|---|---|
|
Clone a Long. |
|
Convert Float to Long, discarding decimals. |
|
Upcast Int to Long. |
|
Convert Double to Long, discarding decimals. |
|
Parse String to Long. Throws NumberFormatException if invalid. |
Method |
Return Type |
Description |
|---|---|---|
|
String |
Returns the String representation of this Long. |
9.3.1.4. Float
Represents decimal numbers with single precision.
Default value: 0.0
Literal: Any decimal number (3.14, -0.5, 1.0)
Constructor |
Description |
|---|---|
|
Cast Long to Float (may incur precision loss). |
|
Clone a Float. |
|
Cast Int to Float. |
|
Cast Double to Float (may incur precision loss). |
|
Parse String to Float. Throws NumberFormatException if invalid. |
Method |
Return Type |
Description |
|---|---|---|
|
String |
Returns the String representation of this Float. |
9.3.1.5. Double
Represents decimal numbers with double precision.
Default value: 0.0
Literal: Number with D suffix (3.14D, 1D)
Constructor |
Description |
|---|---|
|
Cast Long to Double. |
|
Upcast Float to Double. |
|
Cast Int to Double. |
|
Clone a Double. |
|
Parse String to Double. Throws NumberFormatException if invalid. |
Method |
Return Type |
Description |
|---|---|---|
|
String |
Returns the String representation of this Double. |
9.3.1.6. Boolean
Represents true or false.
Default value: false
Literal: true or false
Constructor |
Description |
|---|---|
|
Copy a Boolean. |
|
Parse |
9.3.2. Minecraft Objects
9.3.2.1. Player
Represents an online Minecraft player.
Default value: null
Constructor |
Description |
|---|---|
|
Find player by name or UUID. Returns null if not found. |
|
Find player by name, only if visible to visibleTo. |
|
Find player at coordinates. Returns null if not found. |
Method |
Return Type |
Description |
|---|---|---|
|
Boolean |
True if can see target player. |
|
Void |
Close open inventory. |
|
Int |
Count items of type in inventory. |
|
Void |
Deal damage to player. |
|
Boolean |
Drop held item (or stack if dropAll). |
|
Int |
Times hit a starting checkpoint. |
|
Location |
Location of player’s bed spawn. |
|
String |
World where bed is set. |
|
Double |
X coordinate of bed location. |
|
Double |
Y coordinate of bed location. |
|
Double |
Z coordinate of bed location. |
|
Item |
Boots slot item. |
|
Int |
Total challenge points. |
|
Long |
Current challenge time (-1 if not in challenge). |
|
Item |
Chestplate slot item. |
|
String |
Block face clicked (for interact scripts). |
|
String |
Current challenge tag (or null). |
|
String |
Current checkpoint (or null). |
|
Double |
X component of look direction vector. |
|
Double |
Y component of look direction vector. |
|
Double |
Z component of look direction vector. |
|
String |
Player’s display name (e.g., nickname). |
|
Int |
Get entity-related statistic value. |
|
Float |
XP progress toward next level (0.0 to 1.0). |
|
Float |
Distance fallen since last on ground. |
|
Int |
Ticks until fire stops. |
|
Float |
Current food level. |
|
String |
Current game mode (SURVIVAL, CREATIVE, etc.). |
|
Int |
Global points. |
|
Double |
Current health (0 = dead). |
|
Item |
Helmet slot item. |
|
Int |
Hexa stage reached. |
|
Item |
Item in inventory slot. |
|
Item |
Item in main hand. |
|
Item |
Item in off hand. |
|
Item |
Leggings slot item. |
|
Float |
Current XP level. |
|
String |
Player’s client locale. |
|
Location |
Player’s location. |
|
Long |
Current map time. |
|
Int |
Get material-related statistic value. |
|
Int |
Maximum health. |
|
String |
Player’s Minecraft username. |
|
String |
Player’s object pronoun (e.g., “them”). |
|
Float |
Rotation around X axis. |
|
Long |
Player’s current time. |
|
Long |
Player’s time offset from server. |
|
String |
Player’s current weather type. |
|
Int |
FFA points. |
|
Position |
Player’s position (location + rotation). |
|
String |
Player’s possessive determiner (e.g., “their”). |
|
String |
Player’s possessive pronoun (e.g., “theirs”). |
|
String |
Player’s full pronoun string. |
|
String |
Player’s server rank. |
|
String |
Player’s reflexive pronoun (e.g., “themselves”). |
|
Float |
Current saturation level. |
|
Int |
Speedrun score. |
|
Int |
Get statistic value. |
|
String |
Player’s subject pronoun (e.g., “they”). |
|
Block |
Block player is looking at (max 120). |
|
String |
Face of target block (NORTH, UP, etc.). |
|
Entity |
Entity player is looking at (max 120). |
|
Long |
Playtime in milliseconds. |
|
String |
Player’s UUID. |
|
String |
Current world name. |
|
Double |
X coordinate. |
|
Double |
Y coordinate. |
|
Float |
Rotation around Y axis. |
|
Double |
Z coordinate. |
|
Void |
Give XP points. |
|
Void |
Give XP levels (negative to take). |
|
Boolean |
True if player has a bed spawn set. |
|
Boolean |
True if completed the challenge. |
|
Boolean |
True if completed the map. |
|
Boolean |
True if gravity enabled. |
|
Boolean |
True if player has set pronouns. |
|
Boolean |
True if dead. |
|
Boolean |
True if flying. |
|
Boolean |
True if gliding with elytra. |
|
Boolean |
True if in a vehicle. |
|
Boolean |
True if on solid ground. |
|
Boolean |
True if currently online. |
|
Boolean |
True if server operator. |
|
Boolean |
True if in a challenge. |
|
Boolean |
True if playing a map. |
|
Boolean |
True if sneaking. |
|
Boolean |
True if sprinting. |
|
Boolean |
Leave vehicle. Returns true if was in one. |
|
Void |
Send a chat message. |
|
Void |
Send a rich text message. |
|
Void |
Set boots. |
|
Void |
Set chestplate. |
|
Void |
Set XP progress. |
|
Void |
Set fire ticks. |
|
Void |
Set food level. |
|
Void |
Enable/disable gravity. |
|
Void |
Set health (0 to maxHealth). |
|
Void |
Set helmet. |
|
Void |
Set item in slot. |
|
Void |
Set main hand item. |
|
Void |
Set off hand item. |
|
Void |
Set leggings. |
|
Void |
Set XP level. |
|
Void |
Set maximum health. |
|
Void |
Request resource pack download. |
|
Void |
Set saturation level. |
|
String |
Returns the player’s name. |
|
Void |
Teleport player to position. |
9.3.2.2. Entity
Represents a moveable object in Minecraft (mobs, arrows, item frames, etc.).
Default value: null
Constructor |
Description |
|---|---|
|
Find entity by UUID. Returns null if not found. |
|
Find entity at coordinates. Returns null if not found. |
Method |
Return Type |
Description |
|---|---|---|
|
Boolean |
Add passenger. Returns false if failed. |
|
Void |
Deal damage. |
|
Void |
Eject all passengers. |
|
Double |
X component of facing direction. |
|
Double |
Y component of facing direction. |
|
Double |
Z component of facing direction. |
|
String |
Entity type (magic value, may change). |
|
Double |
Current health. |
|
Location |
Entity’s location. |
|
Int |
Maximum health. |
|
Float |
Rotation around X axis. |
|
Position |
Entity’s position (location with rotation). |
|
String |
Entity UUID. |
|
Double |
X velocity. |
|
Double |
Y velocity. |
|
Double |
Z velocity. |
|
String |
Current world name. |
|
Double |
X coordinate. |
|
Double |
Y coordinate. |
|
Float |
Rotation around Y axis. |
|
Double |
Z coordinate. |
|
Boolean |
True if marked for removal. |
|
Boolean |
True if on solid ground. |
|
Void |
Set health. |
|
Void |
Set maximum health. |
|
String |
Returns the entity’s string representation. |
|
Void |
Teleport entity. |
9.3.2.3. Block
Represents a block in the Minecraft world.
Default value: null
Constructor |
Description |
|---|---|
|
Get block at location. |
|
Get block at coordinates. |
Method |
Return Type |
Description |
|---|---|---|
|
Int |
Redstone power level. |
|
String |
Block type (magic value, may change). |
|
Int |
Light from nearby blocks. |
|
Int |
Light from sky. |
|
Int |
Total light level. |
|
BlockLocation |
Block’s location. |
|
String |
World name. |
|
Int |
X coordinate. |
|
Int |
Y coordinate. |
|
Int |
Z coordinate. |
|
Boolean |
True if indirectly powered. |
|
Boolean |
True if powered by redstone. |
|
Boolean |
True if air. |
|
Boolean |
True if liquid. |
|
String |
Returns the block’s string representation. |
9.3.2.4. Item
Represents an item stack.
Default value: null
Constructor |
Description |
|---|---|
|
Create item by name with stack size. Throws MaterialNotFoundException if invalid. |
Method |
Return Type |
Description |
|---|---|---|
|
Int |
Stack size. |
|
String |
Custom name (null if none). |
|
String |
Item type name. |
|
Int |
Maximum stack size (-1 if unknown). |
|
Boolean |
True if has custom name. |
|
Boolean |
True if same type (ignores amount). |
|
Void |
Set stack size. |
|
Void |
Set item type (resets extra data). |
|
String |
Returns the item’s string representation. |
9.3.3. Spatial Types
9.3.3.1. Location
Represents a position in a world with Double precision coordinates.
Default value: null
Constructor |
Description |
|---|---|
|
Create from a Vector3 and world name. |
|
Create from Double coordinates and world name. |
|
Create from Int coordinates and world name. |
|
Create from Float coordinates and world name. |
Method |
Return Type |
Description |
|---|---|---|
|
BlockLocation |
Convert to block-aligned location. |
|
Vector2 |
Convert to XZ vector (drops Y). |
|
Vector3 |
Convert to XYZ vector. |
|
String |
Get the world name. |
|
Double |
Get the X coordinate. |
|
Double |
Get the Y coordinate. |
|
Double |
Get the Z coordinate. |
|
String |
Returns string representation. |
9.3.3.2. BlockLocation
Represents a block-aligned position in a world with Int precision coordinates.
Default value: null
Constructor |
Description |
|---|---|
|
Create from a BlockVector3 and world name. |
|
Create from Int coordinates and world name. |
Method |
Return Type |
Description |
|---|---|---|
|
BlockVector2 |
Convert to XZ block vector (drops Y). |
|
BlockVector3 |
Convert to XYZ block vector. |
|
Location |
Convert to Location. |
|
Region[] |
Get all regions containing this location. |
|
String |
Get the world name. |
|
Int |
Get the X coordinate. |
|
Int |
Get the Y coordinate. |
|
Int |
Get the Z coordinate. |
|
Void |
Set the block at this location. |
|
String |
Returns string representation. |
9.3.3.3. Position
Like Location, but includes yaw and pitch rotation.
Default value: null
Constructor |
Description |
|---|---|
|
Create from Location with rotation. |
|
Create from Float coordinates and rotation. |
|
Create from Int coordinates and rotation. |
|
Create from Float coords, Int rotation. |
|
Create from Double coords, Float rotation. |
|
Create from Double coords, Int rotation. |
|
Create from Int coords, Float rotation. |
Method |
Return Type |
Description |
|---|---|---|
|
Location |
Convert to Location (loses rotation). |
|
Float |
Get pitch rotation. |
|
String |
Get the world name. |
|
Double |
Get the X coordinate. |
|
Double |
Get the Y coordinate. |
|
Float |
Get yaw rotation. |
|
Double |
Get the Z coordinate. |
|
String |
Returns string representation. |
9.3.3.4. Vector3
3D vector with Double precision, for abstract positions without a world.
Default value: null
Constructor |
Description |
|---|---|
|
Create from Float coordinates. |
|
Create from Long coordinates. |
|
Create from Double coordinates. |
|
Create from Int coordinates. |
Method |
Return Type |
Description |
|---|---|---|
|
Vector3 |
Absolute value of each component. |
|
BlockVector3 |
Convert to block vector (truncates). |
|
Location |
Convert to Location in world. |
|
Vector2 |
Convert to XZ vector (drops Y). |
|
Vector3 |
Ceiling of each component. |
|
Vector3 |
Clamp Y between min and max. |
|
Boolean |
True if within bounding box. |
|
Vector3 |
Cross product with other. |
|
Double |
Distance to other vector. |
|
Double |
Squared distance to other. |
|
Double |
Dot product with other. |
|
Vector3 |
Floor of each component. |
|
Vector3 |
Component-wise maximum. |
|
Vector3 |
Component-wise minimum. |
|
Double |
Get the X component. |
|
Double |
Get the Y component. |
|
Double |
Get the Z component. |
|
Double |
Vector magnitude. |
|
Double |
Squared magnitude. |
|
Vector3 |
Unit vector in same direction. |
|
Vector3 |
Round each component. |
|
String |
Returns string representation. |
|
Vector3 |
2D transform in XZ plane. |
9.3.3.5. BlockVector3
3D vector with Int precision, for block-aligned positions without a world.
Default value: null
Constructor |
Description |
|---|---|
|
Create from Int coordinates. |
Method |
Return Type |
Description |
|---|---|---|
|
BlockVector3 |
Absolute value of each component. |
|
BlockLocation |
Convert to BlockLocation in world. |
|
BlockVector2 |
Convert to XZ block vector (drops Y). |
|
Vector3 |
Convert to Vector3. |
|
BlockVector3 |
Ceiling of each component (no-op for Int). |
|
BlockVector3 |
Clamp Y between min and max. |
|
Boolean |
True if within bounding box. |
|
BlockVector3 |
Cross product with other. |
|
Double |
Distance to other vector. |
|
Double |
Squared distance to other. |
|
Double |
Dot product with other. |
|
BlockVector3 |
Floor of each component (no-op for Int). |
|
BlockVector3 |
Component-wise maximum. |
|
BlockVector3 |
Component-wise minimum. |
|
Int |
Get the X component. |
|
Int |
Get the Y component. |
|
Int |
Get the Z component. |
|
Double |
Vector magnitude. |
|
Double |
Squared magnitude. |
|
BlockVector3 |
Unit vector in same direction. |
|
BlockVector3 |
Round each component (no-op for Int). |
|
String |
Returns string representation. |
|
BlockVector3 |
2D transform in XZ plane. |
9.3.3.6. Vector2
2D vector with Double precision, for XZ plane positions.
Default value: null
Constructor |
Description |
|---|---|
|
Create from Double coordinates. |
|
Create from Long coordinates. |
|
Create from Float coordinates. |
|
Create from Int coordinates. |
Method |
Return Type |
Description |
|---|---|---|
|
Vector2 |
Absolute value of each component. |
|
BlockVector2 |
Convert to block vector (truncates). |
|
Vector3 |
Convert to Vector3 (Y = 0). |
|
Vector2 |
Ceiling of each component. |
|
Boolean |
True if within bounding box. |
|
Double |
Distance to other vector. |
|
Double |
Squared distance to other. |
|
Double |
Dot product with other. |
|
Vector2 |
Floor of each component. |
|
Vector2 |
Component-wise maximum. |
|
Vector2 |
Component-wise minimum. |
|
Double |
Get the X component. |
|
Double |
Get the Z component. |
|
Double |
Vector magnitude. |
|
Double |
Squared magnitude. |
|
Vector2 |
Unit vector in same direction. |
|
Vector2 |
Round each component. |
|
String |
Returns string representation. |
|
Vector2 |
2D transform. |
9.3.3.7. BlockVector2
2D vector with Int precision, for block-aligned XZ plane positions.
Default value: null
Constructor |
Description |
|---|---|
|
Create from Int coordinates. |
Method |
Return Type |
Description |
|---|---|---|
|
BlockVector2 |
Absolute value of each component. |
|
BlockVector3 |
Convert to BlockVector3 (Y = 0). |
|
Vector2 |
Convert to Vector2. |
|
BlockVector2 |
Ceiling of each component (no-op for Int). |
|
Boolean |
True if within bounding box. |
|
Double |
Distance to other vector. |
|
Double |
Squared distance to other. |
|
Double |
Dot product with other. |
|
BlockVector2 |
Floor of each component (no-op for Int). |
|
BlockVector2 |
Component-wise maximum. |
|
BlockVector2 |
Component-wise minimum. |
|
Int |
Get the X component. |
|
Int |
Get the Z component. |
|
Double |
Vector magnitude. |
|
Double |
Squared magnitude. |
|
BlockVector2 |
Unit vector in same direction. |
|
BlockVector2 |
Round each component (no-op for Int). |
|
String |
Returns string representation. |
|
BlockVector2 |
2D transform. |
9.3.3.8. Region
Wrapper for WorldGuard regions.
Default value: null
Constructor |
Description |
|---|---|
|
Look up existing WorldGuard region. |
|
Create transient cuboid region. |
|
Create transient polygonal region. |
|
Create named transient cuboid region. |
|
Create named transient polygonal region. |
|
Create transient cuboid from coordinates. |
|
Create named transient cuboid from coordinates. |
Note
Transient regions created via constructor are not saved to WorldGuard and are not visible to /region info or the spider eye.
Method |
Return Type |
Description |
|---|---|---|
|
Void |
Add a group as member. |
|
Void |
Add a player as member. |
|
Void |
Add a group as owner. |
|
Void |
Add a player as owner. |
|
Void |
Remove parent region. |
|
Boolean |
True if any position is inside. |
|
Boolean |
True if vector is inside (2D check). |
|
Boolean |
True if vector is inside. |
|
Boolean |
True if coordinates are inside. |
|
Boolean |
True if location is inside. |
|
Boolean |
True if player is inside. |
|
Double |
Get a Double flag value. |
|
String |
Get the region ID. |
|
Int |
Get an Int flag value. |
|
Region[] |
Get regions that intersect. |
|
BlockLocation |
Maximum corner. |
|
String[] |
Member group names. |
|
Player[] |
Region members. |
|
BlockLocation |
Minimum corner. |
|
String[] |
Owner group names. |
|
Player[] |
Region owners. |
|
Region |
Get parent region. |
|
Player[] |
All players currently inside. |
|
Vector2[] |
Get polygon points. |
|
Int |
Get region priority. |
|
String |
Get the region type. |
|
Int |
Get the region volume. |
|
String |
Get the world name. |
|
Boolean |
True if has any members or owners. |
|
Boolean |
True if group is a member. |
|
Boolean |
True if player is a member. |
|
Boolean |
True if group is an owner. |
|
Boolean |
True if player is an owner. |
|
Boolean |
True if has physical bounds. |
|
Boolean |
True if not saved to WorldGuard. |
|
Void |
Set a Double flag value. |
|
Void |
Set an Int flag value. |
|
Void |
Set parent region. |
|
Void |
Set region priority. |
|
String |
Returns string representation. |
9.3.4. Reference Types
These types represent Minecraft registry entries. They have no constructors; use the predefined instances from their namespaces (e.g., entity::zombie, material::diamond).
9.3.4.1. entity::EntityType
Represents a Minecraft entity type. Access via entity:: namespace variables (e.g., entity::zombie, entity::creeper).
Method |
Return Type |
Description |
|---|---|---|
|
String |
Get the entity type name (e.g., |
|
String |
Returns string representation. |
9.3.4.2. material::Material
Represents a Minecraft material (item or block type). Access via material:: namespace variables (e.g., material::diamond, material::diamondBlock).
Method |
Return Type |
Description |
|---|---|---|
|
Float |
Block’s explosion resistance. |
|
String |
Bukkit material name. |
|
Material |
Item left after crafting (e.g., bucket). |
|
Float |
Block’s hardness value. |
|
String |
Material ID string. |
|
NamespacedKey |
Namespaced key (e.g., |
|
Int |
Max durability for tools/armor. |
|
Int |
Maximum stack size (usually 64). |
|
String |
Minecraft translation key. |
|
Boolean |
True if affected by gravity (sand, gravel). |
|
Boolean |
True if air block. |
|
Boolean |
True if placeable as block. |
|
Boolean |
True if can burn. |
|
Boolean |
True if food item. |
|
Boolean |
True if catches fire. |
|
Boolean |
True if usable as furnace fuel. |
|
Boolean |
True if has right-click action. |
|
Boolean |
True if blocks light fully. |
|
Boolean |
True if music disc. |
|
Boolean |
True if solid block. |
|
String |
Returns string representation. |
9.3.4.3. statistic::Statistic
Represents a Minecraft statistic. Access via statistic:: namespace variables (e.g., statistic::jump, statistic::walkOneCm).
Method |
Return Type |
Description |
|---|---|---|
|
NamespacedKey |
Namespaced key for the statistic. |
|
String |
Get the statistic name (e.g., |
|
String |
Returns string representation. |
9.3.4.4. NamespacedKey
Represents a Minecraft namespaced identifier (e.g., minecraft:diamond). Returned by methods like Material.getKey() and Statistic.getKey(). No constructors.
Method |
Return Type |
Description |
|---|---|---|
|
String |
Get the key part (e.g., |
|
String |
Get the namespace part (e.g., |
|
String |
Returns full identifier (e.g., |
9.3.5. Map Types
Types for interacting with Minr maps, challenges, and timers.
9.3.5.1. minr::Challenge
Represents a Minr challenge. Used for querying challenge leaderboards.
Constructor |
Description |
|---|---|
|
Create from challenge tag. |
Method |
Return Type |
Description |
|---|---|---|
|
Player |
Get player at leaderboard rank. |
|
Player |
Get player with specific time. |
|
Int |
Get rank for a given time. |
|
Long |
Get time at leaderboard rank. |
|
Long |
Get player’s best time. |
|
String |
Returns string representation. |
9.3.5.2. minr::Map
Represents a Minr map. Used for querying map leaderboards.
Constructor |
Description |
|---|---|
|
Create from map tag. |
Method |
Return Type |
Description |
|---|---|---|
|
Player |
Get player at leaderboard rank. |
|
Player |
Get player with specific time. |
|
Int |
Get rank for a given time. |
|
Long |
Get time at leaderboard rank. |
|
Long |
Get player’s best time. |
|
String |
Returns string representation. |
9.3.5.3. timer::Timer
Represents a timer instance for tracking player progress on maps or challenges.
Constructor |
Description |
|---|---|
|
Create timer for player. |
|
Create timer, optionally silent. |
|
Create timer with validation option. |
Method |
Return Type |
Description |
|---|---|---|
|
Void |
Deactivate the timer. |
|
Void |
Finish the timer. |
|
Long |
Get elapsed time since start. |
|
Long |
Get the finish timestamp. |
|
String |
Get the timer name. |
|
Long |
Get the start timestamp. |
|
String |
Get the timer tag. |
|
String |
Get the timer type. |
|
Void |
Mark timer as invalid. |
|
Boolean |
True if timer is running. |
|
Boolean |
True if timer is invalid. |
|
Boolean |
True if timer is nullified. |
|
Void |
Nullify the timer. |
|
Void |
Set the finish timestamp. |
|
Void |
Set invalid state. |
|
Void |
Set nullified state. |
|
Void |
Set the start timestamp. |
|
Void |
Start the timer. |
|
String |
Returns string representation. |
Warning
Never store Timer instances in namespace variables. They will break silently. Always use timer::getCustomTimer(...) to retrieve a fresh reference.
9.3.6. Text Types
Types for working with rich text (JSON chat components).
9.3.6.1. format::TextFormat
Represents a text color or formatting style. Access predefined formats via format:: namespace variables (e.g., format::green, format::bold), or construct from a color code.
Constructor |
Description |
|---|---|
|
Create from color code character (e.g., |
Method |
Return Type |
Description |
|---|---|---|
|
String |
Returns the section sign code (e.g., |
9.3.6.2. text::TextComponent
A single rich text component with formatting, click events, hover events, etc.
Constructor |
Description |
|---|---|
|
Create from plain text. |
|
Create specific component type (e.g., |
Method |
Return Type |
Description |
|---|---|---|
|
TextComponent |
Add child component. |
|
TextComponent |
Add child text. |
|
TextComponent |
Remove bold formatting. |
|
TextComponent |
Remove click event. |
|
TextComponent |
Remove italic formatting. |
|
TextComponent |
Remove obfuscated formatting. |
|
TextComponent |
Remove strikethrough. |
|
TextComponent |
Remove underline. |
|
TextComponent |
Copy formatting from another component. |
|
String |
Get debug representation. |
|
TextComponent |
Create a copy. |
|
String |
Get click event action type. |
|
String |
Get click event value. |
|
TextFormat |
Get effective color. |
|
TextFormat |
Get directly set color. |
|
String |
Get component type. |
|
String |
Get text content. |
|
TextComponent[] |
Get child components. |
|
String |
Get effective font. |
|
String |
Get directly set font. |
|
String |
Get shift-click insertion text. |
|
Boolean |
True if has any formatting. |
|
Boolean |
True if bold (inherited). |
|
Boolean |
True if bold (directly set). |
|
Boolean |
True if italic (inherited). |
|
Boolean |
True if italic (directly set). |
|
Boolean |
True if obfuscated (inherited). |
|
Boolean |
True if obfuscated (directly set). |
|
Boolean |
True if strikethrough (inherited). |
|
Boolean |
True if strikethrough (directly set). |
|
Boolean |
True if underlined (inherited). |
|
Boolean |
True if underlined (directly set). |
|
TextComponent |
Retain specific formatting. |
|
String |
Convert to JSON string. |
|
TextComponent |
Set bold formatting. |
|
TextComponent |
Set click event. |
|
TextComponent |
Set text color. |
|
TextComponent |
Set text content. |
|
TextComponent |
Set child components. |
|
TextComponent |
Set font. |
|
TextComponent |
Set shift-click insertion. |
|
TextComponent |
Set italic formatting. |
|
TextComponent |
Set obfuscated formatting. |
|
TextComponent |
Set strikethrough. |
|
TextComponent |
Set underline. |
|
String |
Returns string representation. |
|
String |
Convert to legacy color-coded text. |
|
String |
Convert to plain text (no formatting). |
9.3.6.3. text::ComponentBuilder
Builder pattern for constructing TextComponent arrays. Methods return the builder for chaining.
Constructor |
Description |
|---|---|
|
Create empty builder. |
|
Create from existing component. |
|
Copy another builder. |
|
Create with initial text. |
Method |
Return Type |
Description |
|---|---|---|
|
ComponentBuilder |
Append a component. |
|
ComponentBuilder |
Append component, retaining format. |
|
ComponentBuilder |
Append multiple components. |
|
ComponentBuilder |
Append components, retaining format. |
|
ComponentBuilder |
Append legacy color-coded text. |
|
ComponentBuilder |
Append plain text. |
|
ComponentBuilder |
Append text, retaining format. |
|
ComponentBuilder |
Set bold on current. |
|
ComponentBuilder |
Set click event on current. |
|
ComponentBuilder |
Set color on current. |
|
TextComponent[] |
Build the component array. |
|
ComponentBuilder |
Set font on current. |
|
TextComponent |
Get component at position. |
|
TextComponent |
Get current component. |
|
ComponentBuilder |
Set insertion on current. |
|
ComponentBuilder |
Set italic on current. |
|
ComponentBuilder |
Set obfuscated on current. |
|
Void |
Remove component at position. |
|
ComponentBuilder |
Reset current formatting. |
|
ComponentBuilder |
Reset cursor to end. |
|
ComponentBuilder |
Set format retention mode. |
|
ComponentBuilder |
Set cursor position. |
|
ComponentBuilder |
Set strikethrough on current. |
|
String |
Returns string representation. |
|
ComponentBuilder |
Set underline on current. |