Class: MMOItem

MMOItem

The MMOItem class represents a non-player entity inside an MMORoom.

MMOItems can represent bonuses, triggers, bullets or any other non-player entites inside an MMORoom; these will be handled with the same Area of Interest (AOI) rules applicable to users. This means that whenever one or more MMOItems fall within the AOI of a player, their presence will be notified to the client via a PROXIMITY_LIST_UPDATE event together with their id(s) and MMOItem Variables.

Notes

See also


new MMOItem( [variables])

Creates a new MMOItem instance.
Parameters:
Name Type Argument Default Description
variables Array.<MMOItemVariable> <optional>
null A list of MMOItemVariable objects assigned to the MMOItem upon creation.
Example

In this example we create a new MMOItem, attaching a couple of MMOItem Variables to it.

// Prepare the variables
var vars = [
		new MMOItemVariable("type", "1"), // identifies the type of bonus based on our game rules
		new MMOitemVariable("val", 100)   // the value of the bonus
	   ];

// Create the item
var bonus = new MMOItem(vars);

// Add the MMOItem to the MMORoom at specific coordinates
getMMOApi().setMMOItemPosition(bonus, Vectors.newVec3D(10, 20, 5, false), theMMORoom);