Docs » API reference » Creature

Creature

One Voxelmon: wild, a player's companion, or kept in a player's team.

Every creature has a lasting id. A wild one exists only while it is in the world, and a player's is saved with that player. Spawning, changing and removing creatures needs creatures.

A handle to something in the game. Once that thing is gone, its calls fail with Gone. You get one from world.creatures_near(...), a team, and events.

Methods

MethodDescription
fn id(&self) -> Result<CreatureId>long id()Its lasting ID.
fn species(&self) -> Result<Species>Species species()Its species.
fn level(&self) -> Result<i64>long level()Its level.
fn experience(&self) -> Result<i64>long experience()Experience toward its next level.
fn health(&self) -> Result<f64>double health()Its health now.
fn max_health(&self) -> Result<f64>double maxHealth()Its most health.
fn size(&self) -> Result<Size>Size size()How large it is.
fn moves(&self) -> Result<Vec<Move>>List<Move> moves()The moves it knows (up to four).
fn stats(&self) -> Result<Stats>Stats stats()Its battle stats at its level.
fn status(&self) -> Result<Status>Status status()A status it suffers in battle.
fn owner(&self) -> Result<Option<PlayerId>>Optional<String> owner()Its player, if it is someone's.
fn state(&self) -> Result<CreatureState>CreatureState state()Where it is.
fn position(&self) -> Result<Option<Place>>Optional<Place> position()Where it is, if in the world.
fn set_level(&self, level: i64) -> Result<()>void setLevel(long level) creaturesSets its level (its stats follow).
fn add_experience(&self, amount: i64) -> Result<()>void addExperience(long amount) creaturesGives experience (it may level up and evolve).
fn heal(&self, amount: f64) -> Result<()>void heal(double amount)Gives back health.
fn heal_fully(&self) -> Result<()>void healFully()Health, moves and status restored, as at a clinic.
fn damage(&self, amount: f64) -> Result<()>void damage(double amount)Hurts it.
fn teach(&self, r#move: Move, slot: i64) -> Result<()>void teach(Move move, long slot) creaturesTeaches a move in place of the one in that slot (0 to 3).
fn teleport(&self, place: Place) -> Result<()>void teleport(Place place) creaturesMoves it, if in the world.
fn rile(&self, player: Player) -> Result<()>void rile(Player player)Turns a wild one on a player for a while.
fn give_to(&self, player: Player) -> Result<bool>boolean giveTo(Player player) creaturesMakes a wild one theirs, as if caught; false if their team is full.
fn challenge(&self, player: Player) -> Result<Option<Battle>>Optional<Battle> challenge(Player player)Starts a turn-based battle between a wild one and a player, in a turn-based world.
fn remove(&self) -> Result<()>void remove() creaturesTakes a wild one out of the world.

Stats

A creature's battle stats.

Plain data, copied between the server and the plugin.

FieldDescription
health: i64long health()Most health.
attack: i64long attack()Attack.
defense: i64long defense()Defense.
speed: i64long speed()Battle speed: who moves first.

Size

How large a creature is drawn.

One of a fixed set of values.

ValueMeaning
Size::MicroscopicSize.MICROSCOPICMicroscopic.
Size::TinySize.TINYTiny.
Size::PetiteSize.PETITEPetite.
Size::SmallSize.SMALLSmall.
Size::AverageSize.AVERAGEAverage.
Size::LargeSize.LARGELarge.
Size::HugeSize.HUGEHuge.
Size::GiganticSize.GIGANTICGigantic.
Size::ColossalSize.COLOSSALColossal.
Size::VoxelordSize.VOXELORDA town's Voxelord.

Status

A battle status.

One of a fixed set of values.

ValueMeaning
Status::HealthyStatus.HEALTHYNone.
Status::BurnStatus.BURNBurned.
Status::PoisonStatus.POISONPoisoned.
Status::FrostStatus.FROSTFrozen.
Status::ParalysisStatus.PARALYSISParalysed.
Status::SleepStatus.SLEEPAsleep.

CreatureState

Where a creature is.

One of a fixed set of values.

ValueMeaning
CreatureState::WildCreatureState.WILDWild, in the world.
CreatureState::OutCreatureState.OUTA player's companion, out of its cube.
CreatureState::InCubeCreatureState.IN_CUBEIn a cube on its player's belt.
CreatureState::StoredCreatureState.STOREDIn its player's storage.
CreatureState::InBattleCreatureState.IN_BATTLEIn a battle.

Events

Related events: CreatureSpawning, CreatureSpawned, CreatureDamaging, CreatureBeaten, CaptureAttempt, CreatureCaptured, CreatureLevelledUp, CreatureEvolving, CreatureEvolved, CompanionSentOut, CompanionRecalled, CreaturePetted.