Docs » API reference » Types

Types

The small values every page uses: places, block positions, IDs, colours, times and settings.

Place

A point in the world, in blocks (one block is one metre); y is up.

Plain data, copied between the server and the plugin.

FieldDescription
x: f64double x()East.
y: f64double y()Up.
z: f64double z()South.

BlockPos

A block's place. y runs from -64 to 191.

Plain data, copied between the server and the plugin.

FieldDescription
x: i64long x()East.
y: i64long y()Up.
z: i64long z()South.

Turn

How something is turned (a quaternion).

Plain data, copied between the server and the plugin.

FieldDescription
x: f64double x()Its x part.
y: f64double y()Its y part.
z: f64double z()Its z part.
w: f64double w()Its w part.

Colour

A colour, each part 0 to 255.

Plain data, copied between the server and the plugin.

FieldDescription
r: i64long r()Red.
g: i64long g()Green.
b: i64long b()Blue.

WorldOptions

The world's settings, as in server.toml.

Plain data, copied between the server and the plugin.

FieldDescription
difficulty: DifficultyDifficulty difficulty()Normal, hard or hardcore.
combat: CombatStyleCombatStyle combat()Turn-based battles or real-time action.
keep_inventory: boolboolean keepInventory()Whether a player who faints keeps what they carry.
creative: boolboolean creative()Creative mode for everyone.

Difficulty

How hard the world is.

One of a fixed set of values.

ValueMeaning
Difficulty::NormalDifficulty.NORMALNormal.
Difficulty::HardDifficulty.HARDCreatures hit harder and starving can make a player faint.
Difficulty::HardcoreDifficulty.HARDCOREHard, and one life: a player who faints stays down.

CombatStyle

How fights work.

One of a fixed set of values.

ValueMeaning
CombatStyle::TurnBasedCombatStyle.TURN_BASEDTurn-based battles.
CombatStyle::ActionCombatStyle.ACTIONReal-time combat.

Store

Which store a player's account is from.

One of a fixed set of values.

ValueMeaning
Store::MetaStore.METAThe Meta Horizon Store (Quest).
Store::PicoStore.PICOThe PICO Store.
Store::SteamStore.STEAMSteam.
Store::NoneStore.NONENo store account (development servers only).

LeaveReason

Why a player left.

One of a fixed set of values.

ValueMeaning
LeaveReason::LeftLeaveReason.LEFTThey left.
LeaveReason::KickedLeaveReason.KICKEDThey were put out.
LeaveReason::BlockedLeaveReason.BLOCKEDThey were blocked.
LeaveReason::ConnectionLostLeaveReason.CONNECTION_LOSTTheir connection ended.
LeaveReason::ServerStoppingLeaveReason.SERVER_STOPPINGThe server is stopping.

DamageCause

What hurt a player.

One of a fixed set of values.

ValueMeaning
DamageCause::CreatureDamageCause.CREATUREA creature's attack or shot.
DamageCause::FallDamageCause.FALLA fall.
DamageCause::DrowningDamageCause.DROWNINGRunning out of breath.
DamageCause::HungerDamageCause.HUNGERStarving.
DamageCause::BurningDamageCause.BURNINGBurning, after lava.
DamageCause::LavaDamageCause.LAVALava.
DamageCause::TrapDamageCause.TRAPA dungeon trap.
DamageCause::FallingBlockDamageCause.FALLING_BLOCKA falling spike or block.
DamageCause::PluginDamageCause.PLUGINA plugin.
DamageCause::OtherDamageCause.OTHERAnything else.

SpawnReason

Why a Voxelmon appeared.

One of a fixed set of values.

ValueMeaning
SpawnReason::WildSpawnReason.WILDThe wild.
SpawnReason::DungeonSpawnReason.DUNGEONA dungeon.
SpawnReason::DenSpawnReason.DENA den underground.
SpawnReason::HiveSpawnReason.HIVEA hive.
SpawnReason::FishingSpawnReason.FISHINGA fishing hook.
SpawnReason::BreedingSpawnReason.BREEDINGBreeding at a ranch.
SpawnReason::GuardianSpawnReason.GUARDIANA dungeon guardian or a town's Voxelord.
SpawnReason::PluginSpawnReason.PLUGINA plugin.

LootSource

What loot is for.

One of a fixed set of values.

ValueMeaning
LootSource::ChestLootSource.CHESTA chest in a town or the wild.
LootSource::DungeonChestLootSource.DUNGEON_CHESTA dungeon's chest.
LootSource::SupplyCacheLootSource.SUPPLY_CACHEA supply cache.
LootSource::CreatureLootSource.CREATUREA beaten creature.
LootSource::BattleLootSource.BATTLEA won battle.
LootSource::FishingLootSource.FISHINGA fishing catch.
LootSource::OtherLootSource.OTHERAnything else.

PlayerId

A player's lasting ID: the same each time they join, from their store account through Epic. Keep it as it is.

Written as type PlayerId = String;String (String).

CreatureId

A Voxelmon's lasting ID.

Written as type CreatureId = i64;long (int).

Duration

A length of time, in seconds.

Written as type Duration = f64;double (float).

Time

A moment, as seconds since 1970 (UTC).

Written as type Time = i64;long (int).