Skip to content

Createitem

Create an item Entity of a specific Item, Medal or a Crystal Berry with configurable position and timer before disappearing.

Syntax

(1)

|createitem,itemtype,itemid|

(2)

|createitem,itemtype,itemid,xposition,yposition,zposition|

(3)

|createitem,itemtype,itemid,xposition,yposition,zposition,timer|

Parameters

itemtype: int

The type of the item. This must be a valid int or an exception will be thrown. Here are the defined types available:

  • 0: Standard item
  • 1: Key item
  • 2: Medal
  • 3: Crystal Berry The type influences the specific behaviors when the item is collected and how to render it. Any other value has undefined behaviors.

itemid: int

The Item or Medal id. This must be a valid Item or Medal id or an exception will be thrown when rendering the Entity.

xposition: float

The x position of where to place the Entity. This must be a valid float or an exception will be thrown. The default value is the x position of the player.

yposition: float

The y position of where to place the Entity. This must be a valid float or an exception will be thrown. The default value is the y position of the player.

zposition: float

The z position of where to place the Entity. This must be a valid float or an exception will be thrown. The default value is the z position of the player.

timer: int

The amount of frames before the item disappear. This must be a valid int or an exception will be thrown. The default value is 300.

Remarks

This will create the item without a velocity and it will also prepend the name with Fixed which gives the Entity the Fixed modifier. Additionally, the RigidBody's constraints of the Entity are frozen and the insideid field set to the current one.