StendhalAPI

From Arianne
Revision as of 21:26, 19 April 2020 by imported>AntumDeluge (Page for common public Stendhal server API)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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

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) true if the entity is not moving.
hasDescription()
Checks if the entity has a description.
returns: (bool) true if the "description" attribute is set.
isObstacle(entity)
Determine if this is an obstacle for another entity.
entity: The entity to check against.
returns: (bool) true if combined resistance is above 95.

ActiveEntity

GuidedEntity

RPEntity

See Also