StendhalAPI
this page is a work-in progress
Description
This page is intended to be a description of the common usable methods for adding or altering the world of Stendhal.
Entities
Base Classes
Entity
- Class: games.stendhal.server.entity.Entity
- Inherits: marauroa.common.game.RPObject
- Implements:
This is the base entity class for all entities in Stendhal.
Public methods:
- Entity()
- Default constructor.
- Entity(object)
- Copy constructor.
- object: Object to be copied.
- setDescription(text)
- Sets the description text for the entity.
- text: String to be used for description.
- getTitle()
- Retrieves the entity's title/name text.
- returns: (
string) The entity's name.
- getDescription()
- Retrieves the entity's description text.
- returns: (
string) The entity's description text.
- getZone()
- returns: (
StendhalRPZone) The current zone where the entity is located.
- getX()
- returns: (
int) The horizontal coordinate of the entity's position.
- getY()
- returns: (
int) The vertical coordinate of the entity's position.
- getResistance(entity)
- Retrieves the resistance this entity has on other entities.
- entity: (optional) If set, returned value is combined resistance.
- returns: (
int) Value between 0-100 (0 = no resistance, 100 = non-traversable).
- stopped()
- returns: (
bool)trueif the entity is not moving.
- hasDescription()
- Checks if the entity has a description.
- returns: (
bool)trueif the "description" attribute is set.
- isObstacle(entity)
- Determine if this is an obstacle for another entity.
- entity: The entity to check against.
- returns: (
bool)trueif combined resistance is above 95.
ActiveEntity
- Class: games.stendhal.server.entity.ActiveEntity
- Inherits: Entity
GuidedEntity
- Class: games.stendhal.server.entity.GuidedEntity
- Inherits: ActiveEntity
RPEntity
- Class: games.stendhal.server.entity.RPEntity
- Inherits: GuidedEntity