From c30e5b69478b094f47b7fa9f16f6ffea890db588 Mon Sep 17 00:00:00 2001 From: loosewheel <76670709+loosewheel@users.noreply.github.com> Date: Sun, 14 Nov 2021 06:05:23 +1000 Subject: [PATCH] Add files via upload --- docs/api.txt | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/api.txt b/docs/api.txt index 8b13789..1b0621f 100644 --- a/docs/api.txt +++ b/docs/api.txt @@ -1 +1,47 @@ + +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) + + 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 } + + 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 weather 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).