Upload files to "lwcomponents/docs"
This commit is contained in:
parent
fd06288848
commit
19b6279455
26 changed files with 1571 additions and 0 deletions
51
lwcomponents/docs/api.txt
Normal file
51
lwcomponents/docs/api.txt
Normal file
|
@ -0,0 +1,51 @@
|
|||
|
||||
|
||||
lwcomponents.version ()
|
||||
Returns this mod version as a string. eg. "0.1.5".
|
||||
|
||||
|
||||
|
||||
lwcomponents.register_spawner (itemname, spawn_func)
|
||||
|
||||
itemname:
|
||||
Registered string name of the spawner item
|
||||
|
||||
spawn_func:
|
||||
The function to call to spawn the mob of the form -
|
||||
|
||||
spawn_func (spawn_pos, itemstack, owner, spawner_pos, spawner_dir, force)
|
||||
|
||||
spawn_pos:
|
||||
The position the entity should be spawned at.
|
||||
|
||||
itemstack:
|
||||
The spawner ItemStack, of the name itemname.
|
||||
|
||||
owner:
|
||||
As string of the player's name that will own the spawned entity,
|
||||
if applicable. This may be "" for no owner.
|
||||
|
||||
spawner_pos:
|
||||
The position of the block calling this function.
|
||||
|
||||
spawner_dir:
|
||||
A single unit vector of the direction the spawner block is facing.
|
||||
eg. { x = -1, y = 0, z = 0 }
|
||||
|
||||
force:
|
||||
Recommended force (for velocity) of spawned entity.
|
||||
Can use vector.multiply (spawner_dir, force).
|
||||
|
||||
This function should return the ObjectRef of the spawned entity or
|
||||
nil. If this function returns nil for ObjectRef a second boolean
|
||||
value should be returned for whether to cancel the action.
|
||||
|
||||
eg. If too many mobs:
|
||||
return nil, true
|
||||
|
||||
eg. If only chance of spawn and out of luck:
|
||||
return nil, false
|
||||
|
||||
The register function return true on success, or false on failure
|
||||
(parameter type check failed or the spawn item has already been
|
||||
registered).
|
Loading…
Add table
Add a link
Reference in a new issue