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);