Skip to content

Instantly share code, notes, and snippets.

@kaeza

kaeza/minetest.ldef Secret

Created Sep 2, 2015
Embed
What would you like to do?
function dump2(obj:any, name:string="_", dumped:table={})
function dump(obj:any, dumped:table=nil)
table Vec3
var x:number
var y:number
var z:number
end
enum CheatInfoType = moved_too_fast, interacted_too_far, \
finished_unknown_dig, dug_unbreakable, dug_too_fast
table MapNode
var name:string
var param1:number
var param2:number
end
table CheatInfo
var type:CheatInfoType
end
table PrivDef
var description:string
var give_to_singleplayer:boolean
end
table GenNotifyFlags
var dungeon:boolean|nil
var temple:boolean|nil
var cave_begin:boolean|nil
var cave_end:boolean|nil
var large_cave_begin:boolean|nil
var large_cave_end:boolean|nil
var decoration:boolean|nil
end
table MapgenParams
var mgname:string
var seed:number
var chunksize:number
var water_level:number
var flags:string
end
namespace vector
function new(x:number|Vec3, y:number|nil, z:number|nil):Vec3
function direction(p1:Vec3, p2:Vec3):Vec3
function distance(p1:Vec3, p2:Vec3):number
function length(v:Vec3):number
function normalize(v:Vec3):Vec3
function round(v:Vec3):Vec3
function apply(v:Vec3, func:function):Vec3
function equals(v1:Vec3, v2:Vec3):boolean
function add(v1:Vec3, x:Vec3|number):Vec3
function subtract(v1:Vec3, x:Vec3|number):Vec3
function multiply(v1:Vec3, x:Vec3|number):Vec3
function divide(v1:Vec3, x:Vec3|number):Vec3
end
namespace math
function hypot(x:number, y:number):number
function sign(x:number, tolerance:number=0):number
end
namespace string
function split(str:string, separator:string=",", \
include_empty:boolean=false, max_splits:number=-1, \
sep_is_pattern:boolean=false):array<string>
function trim(str:string):string
end
namespace table
function copy(t:table):table
end
table PlayerInfo
var address:string
var ip_version:number
var min_rtt:number
var max_rtt:number
var avg_rtt:number
var min_jitter:number
var max_jitter:number
var avg_jitter:number
var connection_uptime:number
end
enum PathfinderAlgorithm = A*_noprefetch, A*, Dijkstra
enum InvLocType = undefined, player, node, detached
table InvLoc
var type:InvLocType
var name:string
var pos:Vec3
end
table AnimationRange
var x:number
var y:number
end
table PlayerControl
var jump:boolean
var right:boolean
var left:boolean
var LMB:boolean
var RMB:boolean
var sneak:boolean
var aux1:boolean
var down:boolean
var up:boolean
end
table PhysicsTable
var speed:number
var jump:number
var gravity:number
var sneak:boolean
var sneak_glitch:boolean
end
enum HUDStat = position, name, scale, text, number, item, dir
table HUDFlags
var hotbar:boolean|nil
var healthbar:boolean|nil
var crosshair:boolean|nil
var wielditem:boolean|nil
var minimap:boolean|nil
end
enum BuiltinHUD = breath, health
enum TableEventType = INV, CHG, DCL
table TableEvent
var type:TableEventType
var row:number
var column:number
end
enum TextListEventType = INV, CHG, DCL
table TextListEvent
var type:TextListEventType
var index:number
end
enum ScrollbarEventType = INV, CHG, VAL
table ScrollbarEvent
var type:ScrollbarEventType
var value:number
end
enum CraftMethod = normal, cooking, fuel
table CraftInput
var method:CraftMethod
var width:number
var items:table
end
table CraftOutput
var item:ItemStack
var time:number
var replacements:table
var decremented_input:CraftInput
end
table RollbackNodeAction
var actor:string
var pos:Vec3
var time:number
var oldnode:MapNode
var newnode:MapNode
end
enum SchematicRotation = 0, 90, 180, 270, random
table SerializeSchematicOptions
var lua_use_comments:boolean
var lua_num_indent_spaces:boolean
end
enum CompressionMethod = deflate
table RnPOrientFlags
var invert_wall:boolean
var force_wall:boolean
var force_ceiling:boolean
var force_floor:boolean
var force_facedir:boolean
end
enum SkyType = regular, skybox, plain
table Color
var r:number
var g:number
var b:number
var a:number
end
table NameTagAttrs
var color:Color
end
table Inventory
var fields:table
var inventory:table<string, table>
end
class NodeMetaRef
function set_string(name:string, value:string)
function get_string(name:string):string
function set_int(name:string, value:number)
function get_int(name:string):number
function set_float(name:string, value:number)
function get_float(name:string):number
function get_inventory():InvRef
function to_table():Inventory
function from_table(t:Inventory)
end
class NodeTimerRef
function set(timeout:number, elapsed:number)
function start(timeout:number)
function stop()
function get_timeout():number
function get_elapsed():number
function is_started():boolean
end
class ObjectRef
function remove()
function getpos():Vec3
function setpos(pos:Vec3)
function moveto(pos:Vec3, continuous:boolean=false)
function punch(puncher:ObjectRef, time_from_last_punch:number, \
tool_capabilities:ToolCaps, direction:Vec3)
function right_click(clicker:ObjectRef)
function get_hp():number
function set_hp(hp:number)
function get_inventory():InvRef
function get_wield_list():string
function get_wield_index():number
function get_wielded_item():ItemStack
function set_wielded_item(item:ItemStack):boolean
function set_armor_groups(groups:table)
function get_armor_groups():table
function set_animation(range:AnimationRange)
function get_animation():(AnimationRange, number, number, boolean)
function set_attach(parent:ObjectRef, bone:string, \
position:Vec3, rotation:Vec3)
function get_attach():(ObjectRef, string, Vec3, Vec3)
function set_detach()
function set_bone_position(bone:string, position:Vec3, rotation:Vec3)
function get_bone_position(bone:string):(Vec3, Vec3)
function set_properties(props:table)
function get_properties():table
function is_player():boolean
end
class LuaObjectRef:ObjectRef
function setvelocity(vel:Vec3)
function getvelocity():Vec3
function setacceleration(accel:Vec3)
function getacceleration():Vec3
function setyaw(radians:number)
function getyaw():number
function settexturemod(mod:string)
function setsprite(pos:Vec3=nil, num_frames:number=1, \
framelength:number=0.2, \
select_horiz_by_yawpitch:boolean=false)
function get_entity_name():string
function get_luaentity():LuaEntity
end
class PlayerRef:ObjectRef
function get_player_name():string
function get_player_velocity():Vec3
function get_look_dir():Vec3
function get_look_pitch():number
function get_look_yaw():number
function set_look_pitch(radians:number)
function set_look_yaw(radians:number)
function get_breath():number
function set_breath(value:number)
function set_inventory_formspec(formspec:string)
function get_inventory_formspec():string
function get_player_control():PlayerControl
function get_player_control_bits():number
function set_physics_override(override_table:PhysicsTable)
function get_physics_override():PhysicsTable
function hud_add(def:HUDDef):number
function hud_remove(id:number)
function hud_change(id:number, stat:HUDStat, value:any)
function hud_get(id:number):HUDDef
function hud_set_flags(flags:HUDFlags)
function hud_get_flags():HUDFlags
function hud_set_hotbar_itemcount(count:number)
function hud_get_hotbar_itemcount():number
function hud_set_hotbar_image(texturename:string)
function hud_get_hotbar_image():string
function hud_set_hotbar_selected_image(texturename:string)
function hud_get_hotbar_selected_image():string
function hud_replace_builtin(name:BuiltinHUD, def:HUDDef)
function set_sky(bgcolor:string, type:SkyType, textures:table)
function get_sky():(string, SkyType, table)
function override_day_night_ratio(ratio:number|nil)
function get_day_night_ratio():number|nil
function set_local_animation(idle:AnimationRange, \
walk:AnimationRange, dig:AnimationRange, \
walk_dig:AnimationRange, frame_speed:number)
function get_local_animation():(AnimationRange, AnimationRange, \
AnimationRange, AnimationRange, number)
function set_eye_offset(fpv:Vec3, tpv:Vec3)
function get_eye_offset():(Vec3, Vec3)
function get_nametag_attributes():NameTagAttrs
function set_nametag_attributes(attributes:NameTagAttrs)
end
class InvRef
function is_empty(listname:string):boolean
function get_size(listname:string):number
function set_size(listname:string, size:number):boolean
function get_width(listname:string):number
function set_width(listname:string, width:number):boolean
function get_stack(listname:string, i:number):ItemStack
function set_stack(listname:string, i:number, stack:ItemStack)
function get_list(listname:string):InventoryList
function set_list(listname:string, list:table<number, ItemStack>)
function get_lists():table<string, table>
function set_lists(lists:table<string, table>)
function add_item(listname:string, stack:ItemStack):ItemStack
function room_for_item(listname:string, stack:ItemStack):boolean
function contains_item(listname:string, stack:ItemStack):boolean
function remove_item(listname:string, stack:ItemStack):ItemStack
function get_location():InvLoc
end
table AreaStoreCacheParams
var enabled:boolean
var block_radius:number
var limit:number
end
class AreaStore
var data:string
constructor(type:AreaStoreType=nil)
function get_area(id:any, include_borders:boolean, \
include_data:boolean):Area
function get_areas_for_pos(pos:Vec3, include_borders:boolean, \
include_data:boolean):array<Area>
function get_areas_in_area(edge1:Vec3, edge2:Vec3, \
accept_overlap:boolean, include_borders:boolean, \
include_data:boolean):array<Area>
function insert_area(edge1:Vec3, edge2:Vec3, data:string)
function reserve(count:number)
function remove_area(id:any):boolean
function set_cache_params(params:AreaStoreCacheParams)
end
table Item
var name:string
var count:number
var wear:number
var metadata:string
end
class ItemStack
constructor(x:ItemStack|string|Item|nil)
function is_empty():boolean
function get_name():string
function set_name(item_name:string):boolean
function get_count():number
function set_count(count:number):boolean
function get_wear():number
function set_wear(wear:number):boolean
function get_metadata():string
function set_metadata(metadata:string):boolean
function clear()
function replace(item:ItemStack|string|Item)
function to_string():string
function to_table():Item
function get_stack_max():number
function get_free_space():number
function is_known():boolean
function get_definition():ItemDef
function get_tool_capabilities():ToolCaps
function add_wear(amount:number)
function add_item(item:ItemStack):ItemStack
function item_fits(item:ItemStack):boolean
function take_item(n:number=1):ItemStack
function peek_item(n:number=1):ItemStack
end
class PseudoRandom
constructor(seed:number)
function next(min:number=nil, max:number=nil):number
end
class PcgRandom
constructor(seed:number, sequence:number=nil)
function next(min:number=nil, max:number=nil):number
function rand_normal_dist(min:number=nil, max:number=nil, \
num_trials:number=6):number
end
enum NoiseParamsFlags = defaults, eased, absvalue
table NoiseParams
var offset:number
var scale:number
var spread:Vec3
var seed:number
var octaves:number
var persistence:number
var lacunarity:number
var flags:string|nil
end
class PerlinNoise
constructor(noiseparams:NoiseParams)
function get2d(pos:Vec3):number
function get3d(pos:Vec3):number
end
class PerlinNoiseMap
constructor(noiseparams:NoiseParams, size:Vec3)
function get2dMap(pos:Vec3):array<array<number>>
function get3dMap(pos:Vec3):array<array<number>>
function get2dMap_flat(pos:Vec3, \
buffer:array<number>=nil):array<number>
function get3dMap_flat(pos:Vec3, \
buffer:array<number>=nil):array<number>
function calc2dMap(pos:Vec3)
function calc3dMap(pos:Vec3)
function getMapSlice(slice_offset:number, slice_size:number, \
buffer:array<number>=nil):array<number>
end
table LightTable
var day:number
var night:number
end
class VoxelManip
constructor()
function read_from_map(p1:Vec3, p2:Vec3):(Vec3, Vec3)
function write_to_map()
function get_node_at(pos:Vec3):MapNode
function set_node_at(pos:Vec3, node:MapNode)
function get_data(buffer:array<number>=nil):array<number>
function set_data(data:array<number>)
function update_map()
function set_lighting(light:LightTable, p1:Vec3=nil, p2:Vec3=nil)
function get_light_data():array<number>
function set_light_data(light_data:array<number>)
function get_param2_data():array<number>
function set_param2_data(param2_data:array<number>)
function calc_lighting(p1:Vec3, p2:Vec3)
function update_liquids()
function was_modified():boolean
function get_emerged_area():(Vec3, Vec3)
end
table VoxelAreaArea
var MinEdge:Vec3
var MaxEdge:Vec3
end
class VoxelArea
function new(area:VoxelAreaArea):VoxelArea
function getExtent():Vec3
function getVolume():number
function index(x:number, y:number, z:number):number
function indexp(p:Vec3):number
function position(i:number):Vec3
function contains(x:number, y:number, z:number):boolean
function containsp(p:Vec3):boolean
function containsi(i:number):boolean
function iter(minx:number, miny:number, minz:number, \
maxx:number, maxy:number, maxz:number):function
function iterp(minp:Vec3, maxp:Vec3):function
end
class Settings
constructor(filename:string)
function get(key:string):string
function get_bool(key:string):boolean
function set(key:string, value:string)
function remove(key:string):boolean
function get_names():array<string>
function write():boolean
function to_table():table
end
enum MapgenObject = voxelmanip, heightmap, biomemap, \
heatmap, humiditymap, gennotify
enum TreeTrunkType = single, double, crossed
table TreeDef
var axiom:string
var rules_a:string
var rules_b:string
var rules_c:string
var rules_d:string
var trunk:string
var leaves:string
var leaves2:string
var leaves2_chance:number
var angle:number
var iterations:number
var random_level:number
var trunk_type:TreeTrunkType
var thin_branches:boolean
var fruit:string
var fruit_chance:number
var seed:number
end
enum EntityVisual = cube, sprite, upright_sprite, mesh, wielditem
table LuaEntity
var name:string
var hp_max:number
var physical:boolean
var collide_with_objects:boolean
var weight:number
var collisionbox:array<number>
var visual:EntityVisual
var visual_size:Vec3
var mesh:string
var textures:array<string>
var colors:array<string|number>
var spritediv:Vec3
var initial_sprite_basepos:Vec3
var is_visible:boolean
var makes_footstep_sound:boolean
var automatic_rotate:boolean
var stepheight:string
var automatic_face_movement_dir:number
var object:ObjectRef
var on_activate:function(self:LuaEntity, staticdata:string)
var on_step:function(dtime)
var on_punch:function(self:LuaEntity, puncher:ObjectRef, \
time_from_last_punch:number, \
tool_capabilities:ToolCaps, dir:Vec3)
var on_rightclick:function(self:LuaEntity, clicker:ObjectRef)
var get_staticdata:function(self:LuaEntity):string
end
table ABMDef
var nodenames:array<string>
var neighbors:array<string>
var interval:number
var chance:number
var action:function(pos:Vec3, node:MapNode, \
active_object_count:number, \
active_object_count_wider:number)
end
table ToolCapsGroupCaps
var times:table<number, number>
var maxwear:number
var maxlevel:number
end
table ToolCaps
var full_punch_interval:number
var max_drop_level:number
var groupcaps:table<string, ToolCapsGroupCaps>
var damage_groups:table<string, number>
end
table SimpleSoundSpec
var name:string
var gain:number
end
table SoundTable
var place:string|SimpleSoundSpec
var dig:string|SimpleSoundSpec
var dug:string|SimpleSoundSpec
var footstep:string|SimpleSoundSpec
end
table DigParams
var wear:number
end
table ItemDef
var description:string
var groups:table<string, number>
var inventory_image:string
var wield_image:string
var wield_scale:Vec3
var stack_max:number
var range:number
var liquids_pointable:boolean
var tool_capabilities:ToolCaps
var node_placement_prediction:string
var sound:SoundTable
var on_place:function(itemstack:ItemStack, placer:ObjectRef, \
pointed_thing:PointedThing)
var on_drop:function(itemstack:ItemStack, dropper:ObjectRef, pos:Vec3)
var on_use:function(itemstack:ItemStack, user:Obj, pointed_thing):ItemStack|nil
var after_use:function(itemstack:ItemStack, user:ObjectRef, node:MapNode, digparams:DigParams):ItemStack|nil
end
enum TileAnimType = vertical_frames
table TileAnimDef
var type:TileAnimType
var aspect_w:number
var aspect_h:number
var length:number
end
table TileDef
var name:string
var animation:TileAnimDef
var backface_culling:boolean
var tileable_vertical:boolean
var tileable_horizontal:boolean
end
enum DrawType = normal, mesh, plantlike, signlike, torchlike, allfaces, \
allfaces_optional, glasslike, glasslike_framed
enum ParamType = none, light
enum ParamType2 = none
enum LiquidType = none, source, flowing
table DropTableItem
var items:array<string>
var rarity:number
end
table DropTable
var max_items:number
var items:array<DropTableItem>
end
table SpecialTileDef
end
enum NodeBoxType = regular, fixed, leveled, wallmounted
table NodeBox
var type:NodeBoxType
var fixed:array<number>|array<array<number>>
var wall_top:array<number>
var wall_bottom:array<number>
var wall_side:array<number>
end
table NodeDef : ItemDef
var drawtype:DrawType
var visual_scale:number
var tiles:array<string>
var special_tiles:array<SpecialTileDef>
var alpha:number
var use_texture_alpha:boolean
var post_effect_color:string|number|Color
var paramtype:ParamType
var paramtype2:ParamType2
var is_ground_content:boolean
var sunlight_propagates:boolean
var walkable:boolean
var pointable:boolean
var diggable:boolean
var climbable:boolean
var buildable_to:boolean
var liquidtype:LiquidType
var liquid_alternative_flowing:string
var liquid_alternative_source:string
var liquid_viscosity:number
var liquid_renewable:boolean
var leveled:number
var liquid_range:number[0..8]
var drowning:number
var light_source:number[0..15]|nil
var damage_per_second:number
var node_box:NodeBox
var mesh:string
var selection_box:NodeBox
var legacy_facedir_simple:boolean
var legacy_wallmounted:boolean
var sounds: SoundTable
var drop: string|DropTable|nil
var on_construct:function(pos:Vec3)
var on_destruct:function(pos:Vec3)
var after_destruct:function(pos:Vec3, oldnode:MapNode)
var after_place_node:function(pos:Vec3, placer:ObjectRef, \
itemstack:ItemStack, \
pointed_thing:PointedThing):boolean
var after_dig_node:function(pos:Vec3, oldnode:MapNode, \
oldmetadata:table, digger:ObjectRef)
var can_dig:function(pos:Vec3, player:ObjectRef|nil):boolean
var on_punch:function(pos:Vec3, node:MapNode, puncher:ObjectRef, \
pointed_thing:PointedThing)
var on_rightclick:function(pos:Vec3, node:MapNode, clicker:ObjectRef, \
itemstack:ItemStack, \
pointed_thing:PointedThing|nil):ItemStack
var on_dig:function(pos:Vec3, node:MapNode, digger:ObjectRef)
var on_timer:function(pos:Vec3, elapsed:number):boolean
var on_receive_fields:function(pos:Vec3, formname:string, \
fields:table, sender:ObjectRef)
var allow_metadata_inventory_move:function(pos:Vec3, \
from_list:string, from_index:number, to_list:string, \
to_index:number, count:number, \
player:ObjectRef):number
var allow_metadata_inventory_put:function(pos:Vec3, \
listname:string, index:number, stack:ItemStack, \
player:ObjectRef):number
var allow_metadata_inventory_take:function(pos:Vec3, \
listname:string, index:number, stack:ItemStack, \
player:ObjectRef):number
var on_metadata_inventory_move:function(pos:Vec3, \
from_list:string, from_index:number, to_list:string, \
to_index:number, count:number, \
player:ObjectRef):number
var on_metadata_inventory_put:function(pos:Vec3, \
listname:string, index:number, stack:ItemStack, \
player:ObjectRef):number
var on_metadata_inventory_take:function(pos:Vec3, \
listname:string, index:number, stack:ItemStack, \
player:ObjectRef):number
var on_blast:function(pos:Vec3, intensity:number)
end
enum RecipeType = shapeless, toolrepair, cooking, fuel
table RecipeDef
var type:RecipeType|nil
var output:string
var recipe:array<array<string>>|array<string>|string
var replacements:array<array<string>>
var additional_wear:number
var cooktime:number
var burntime:number
end
enum OreType = scatter, sheet, blob, vein
enum OreFlags = absheight
table OreDef
var ore_type:OreType
var ore:string
var wherein:string|array<string>
var clust_scarcity:number
var clust_num_ores:number
var clust_size:number
var y_min:number
var y_max:number
var flags:string
var noise_threshhold:number
var noise_params:NoiseParams
-- offset=0, scale=1, spread={x=100, y=100, z=100}, seed=23, octaves=3, persist=0.70}
var random_factor:number
var biomes:string|BiomeDef|number
end
table SchematicDeco
var size:Vec3
var data:array<MapNode>
var yslice_prob:array<SchematicDecoProbItem> = {
end
table SchematicDecoProbItem
var ypos:number
var prob:number
end
enum DecoType = simple, schematic
table DecoDef
var deco_type:DecoType
var place_on:string
var sidelen:number
var fill_ratio:number
var noise_params:NoiseParams
var biomes:string|BiomeDef|number
var y_min:number
var y_max:number
var decoration:string|array<string>
var height:number
var height_max:number
var spawn_by:string
var num_spawn_by:number
var schematic:string|number|SchematicDeco
var replacements:table<string, string>
var flags:string
var rotation:SchematicRotation
end
table ChatCommandDef
var params:string
var description:string
var privs:table<string, string>
var func:function(name:string, param:string):boolean
end
table DetachedInvCallbacks
var allow_move:function(inv:InvRef, from_list:string, \
from_index:number, to_list:string, \
to_index:number, count:number, \
player:ObjectRef):number
var allow_put:function(inv:InvRef, listname:string, \
index:number, stack:ItemStack, \
player:ObjectRef):number
var allow_take:function(inv:InvRef, listname:string, \
index:number, stack:ItemStack, \
player:ObjectRef):number
var on_move:function(inv:InvRef, from_list:string, \
from_index:number, to_list:string, \
to_index:number, count:number, \
player:ObjectRef)
var on_put:function(inv:InvRef, listname:string, \
index:number, stack:ItemStack, \
player:ObjectRef)
var on_take:function(inv:InvRef, listname:string, \
index:number, stack:ItemStack, \
player:ObjectRef)
end
enum HUDElemType = text, image, statbar, waypoint
table HUDDef
var name:string
var hud_elem_type:HUDElemType
var position:Vec3
var scale:Vec3
var text:string
var number:number
var item:number
var direction:number[0..3]
var alignment:Vec3
var offset:Vec3
var size:Vec3
end
table ParticleDef
var pos:Vec3
var velocity:Vec3
var acceleration:Vec3
var expirationtime:number
var size:number
var collisiondetection:boolean
var vertical:boolean
var texture:string
var playername:string
end
table ParticleSpawnerDef
var amount:number
var time:number
var minpos:Vec3
var maxpos:Vec3
var minvel:Vec3
var maxvel:Vec3
var minacc:Vec3
var maxacc:Vec3
var minexptime:number
var maxexptime:number
var minsize:number
var maxsize:number
var collisiondetection:boolean
var vertical:boolean
var texture:string
var playername:string
end
-- TODO: This is (mostly) undocumented in `lua_api.txt`; report.
table BiomeDef
var name:string
end
enum SchematicFormat = mts, lua
namespace minetest
var features:Features
var registered_items:table<string, ItemDef>
var registered_nodes:table<string, ItemDef>
var registered_craftitems:table<string, ItemDef>
var registered_tools:table<string, ToolDef>
var registered_entities:table<string, EntityDef>
var object_refs:table<LuaEntity, number>
var luaentities:table<number, LuaEntity>
var registered_ores:array<OreDef>
var registered_decorations:array<DecoDef>
function pos_to_string(pos:Vec3):string
function string_to_pos(s:string):Vec3
function is_yes(arg:any):boolean
function get_us_time():number
function get_current_modname():string
function get_modpath(modname:string):string
function get_modnames():array<string>
function get_worldpath():string
function is_singleplayer():boolean
function has_feature(arg):(boolean, table)
function get_player_information(player_name:string):PlayerInfo
function mkdir(path:string):boolean
function get_dir_list(path:string, is_dir:boolean|nil=nil):table
function debug(line:string)
function log(loglevel:string="info", line:string)
function register_entity(name:string, def:EntityDef)
function register_abm(def:ABMDef)
function register_node(name:string, def:ItemDef)
function register_tool(name:string, def:ItemDef)
function register_craftitem(name:string, def:ItemDef)
function register_alias(name:string, convert_to:string)
function register_craft(recipe:RecipeDef)
function register_ore(def:OreDef)
function register_decoration(def:DecoDef)
function override_item(name:string, redef:ItemDef)
function clear_registered_ores()
function clear_registered_decorations()
function register_globalstep(func:function(dtime))
function register_on_shutdown(func:function())
function register_on_placenode(func:function(pos:Vec3, newnode:MapNode, \
placer:ObjectRef, oldnode:MapNode, itemstack:ItemStack, \
pointed_thing:PointedThing):ItemStack)
function register_on_dignode(func:function(pos:Vec3, \
oldnode:MapNode, digger:ObjectRef):ItemStack)
function register_on_punchnode(func:function(pos:Vec3, node:MapNode, \
puncher:ObjectRef, pointed_thing:PointedThing))
function register_on_generated(func:function(minp:Vec3, maxp:Vec3, \
blockseed:number))
function register_on_newplayer(func:function(player:ObjectRef))
function register_on_dieplayer(func:function(player:ObjectRef))
function register_on_punchplayer(func:function(player:ObjectRef, \
hitter:ObjectRef, time_from_last_punch:number, \
tool_capabilities:ToolCaps, dir:Vec3, \
damage:number):boolean)
function register_on_player_hpchange(func:function(player:ObjectRef, \
hp_change:number):boolean|number, modifier:boolean)
function register_on_respawnplayer( \
func:function(player:ObjectRef):boolean)
function register_on_prejoinplayer(func:function(name:string, \
ip:string):string|nil)
function register_on_joinplayer(func:function(player:ObjectRef))
function register_on_leaveplayer(func:function(player:ObjectRef))
function register_on_cheat(func:function(player:ObjectRef, \
cheat:CheatInfo))
function register_on_chat_message(func:function(name:string, \
message:string):boolean)
function register_on_player_receive_fields(func:function( \
player:ObjectRef, formname:string, \
fields:table):boolean)
function register_on_craft(func:function(itemstack:ItemStack, \
player:ObjectRef, old_craft_grid:table, \
craft_inv:string):ItemStack)
function register_craft_predict(func:function(itemstack:ItemStack, \
player:ObjectRef, old_craft_grid:table, \
craft_inv:string):ItemStack)
function register_on_protection_violation(func:function(pos:Vec3, \
name:string))
function register_on_item_eat(func:function(hp_change:number, \
replace_with_item:ItemStack, itemstack:ItemStack, \
user:ObjectRef, pointed_thing:PointedThing) \
:ItemStack|boolean)
function register_chatcommand(name:string, def:ChatCommandDef)
function register_privilege(name:string, def:string|PrivDef)
function register_authentication_handler(handler:AuthHandler)
function setting_set(name:string, value:string)
function setting_get(name:string):string|nil
function setting_setbool(name:string, value:boolean)
function setting_getbool(name:string):boolean|nil
function setting_get_pos(name:string):Vec3|nil
function setting_save()
function notify_authentication_modified(name:string|nil)
function get_password_hash(name:string, raw_password:string):string
function string_to_privs(str:string):table
function privs_to_string(privs:table):string
function set_player_password(name:string, password_hash:string)
function set_player_privs(name:string, privs:table)
function get_player_privs(name:string):table
function auth_reload()
function check_player_privs(name:string, privs:string):(boolean,table)
function get_player_ip(name:string):string
function chat_send_all(text:string)
function chat_send_player(name:string, text:string)
function set_node(pos:Vec3, node:MapNode)
function add_node(pos:Vec3, node:MapNode)
function swap_node(pos:Vec3, node:MapNode)
function remove_node(pos:Vec3)
function get_node(pos:Vec3):MapNode
function get_node_or_nil(pos:Vec3):MapNode|nil
function get_node_light(pos:string, timeofday:number|nil):number|nil
function place_node(pos:Vec3, node:MapNode):boolean
function dig_node(pos:Vec3):boolean
function punch_node(pos:Vec3)
function find_nodes_with_meta(pos1:Vec3, pos2:Vec3):table
function get_meta(pos:Vec3):NodeMetaRef
function get_node_timer(pos:Vec3):NodeTimerRef
function add_entity(pos:Vec3, name:string):ObjectRef
function add_item(pos:Vec3, item:string):ObjectRef
function get_player_by_name(name:string):ObjectRef
function get_objects_inside_radius(pos:Vec3, \
radius:number):array<ObjectRef>
function set_timeofday(val:number)
function get_timeofday():number
function get_gametime():number
function find_node_near(pos:Vec3, radius:number, nodenames:table):Vec3
function find_nodes_in_area(minp:Vec3, maxp:Vec3, \
nodenames:array<string>):array<Vec3>
function find_nodes_in_area_under_air(minp:Vec3, maxp:Vec3, \
nodenames:array<string>):array<Vec3>
function get_perlin(noiseparams:NoiseParams):number
function get_voxel_manip(pos1:Vec3|nil, pos2:Vec3|nil):VoxelManip
function set_gen_notify(flags:GenNotifyFlags, {deco_ids})`
function get_gen_notify():GenNotifyFlags
function get_mapgen_object(objectname:MapgenObject):any
function get_mapgen_params():MapgenParams
function set_mapgen_params(params:MapgenParams)
function set_noiseparams(name:string, noiseparams:NoiseParams, \
set_default:boolean)
function get_noiseparams(name:string):NoiseParams
function generate_ores(vm:VoxelManip, pos1:Vec3=nil, pos2:Vec3=nil)
function generate_decorations(vm:VoxelManip, pos1:Vec3=nil, \
pos2:Vec3=nil)
function clear_objects()
function delete_area(pos1:Vec3, pos2:Vec3)
function line_of_sight(pos1:Vec3, pos2:Vec3, \
stepsize:number=1):(boolean, Vec3)
function find_path(pos1:Vec3, pos2:Vec3, searchdistance:number, \
max_jump:number, max_drop:number, \
algorithm:PathfinderAlgorithm="A*_noprefetch"):table
function spawn_tree(pos:Vec3, treedef:TreeDef)
function transforming_liquid_add(pos:Vec3)
function get_node_max_level(pos:Vec3):number
function get_node_level(pos:Vec3):number
function set_node_level(pos:Vec3, level:number):number
function add_node_level(pos:Vec3, level:number=1):number
function get_inventory(location:InvLoc):InvRef
function create_detached_inventory(name:string, \
callbacks:DetachedInvCallbacks):InvRef
function do_item_eat(hp_change:number, replace_with_item:ItemStack, \
itemstack:ItemStack, user:PlayerRef, \
pointed_thing:PointedThing):ItemStack
function show_formspec(playername:string, \
formname:string, formspec:string)
function formspec_escape(s:string):string
function explode_table_event(s:string):TableEvent
function explode_textlist_event(s:string):TextListEvent
function explode_scrollbar_event(s:string):ScrollbarEvent
function inventorycube(img1:string, img2:string, img3:string)
function get_pointed_thing_position(pointed_thing:PointedThing, \
above:boolean):Vec3
function dir_to_facedir(dir:Vec3, is6d:boolean):number
function facedir_to_dir(facedir:number):Vec3
function dir_to_wallmounted(dir:Vec3):number
function get_node_drops(nodename:string, toolname:string):table
function get_craft_result(input:CraftInput):CraftOutput
function get_craft_recipe(output:CraftOutput):CraftInput
function get_all_craft_recipes(item:string):array<CraftOutput>
function handle_node_drops(pos:Vec3, drops:table, digger:ObjectRef)
function rollback_get_node_actions(pos:Vec3, range:number, \
seconds:number, limit:number):table
function rollback_revert_actions_by(actor:string, \
seconds:number):(boolean, array<string>)
function item_place_node(itemstack:ItemStack, placer:ObjectRef, \
pointed_thing:PointedThing, \
param2:number):(ItemStack, boolean)
function item_place_object(itemstack:ItemStack, placer:ObjectRef, \
pointed_thing:PointedThing):(ItemStack, boolean)
function item_place(itemstack:ItemStack, placer:ObjectRef, \
pointed_thing:PointedThing, \
param2:number):(ItemStack, boolean)
function item_drop(itemstack:ItemStack, dropper:ObjectRef, pos:Vec3)
function item_eat(hp_change:number, replace_with_item:string|nil)
function node_punch(pos:Vec3, node:MapNode, puncher:ObjectRef, \
pointed_thing:PointedThing)
function node_dig(pos:Vec3, node:MapNode, digger:ObjectRef)
function sound_play(spec:string|SimpleSoundSpec, \
parameters:SoundParams):number
function sound_stop(handle:number)
function after(time:number, func:function(...), ...)
function request_shutdown(message:string=nil, \
reconnect:boolean=false)
function get_server_status():string
function get_ban_list():table
function get_ban_description(ip_or_name:string):string
function ban_player(name:string)
function unban_player_or_ip(name:string)
function kick_player(name:string, reason:string=nil)
function add_particle(def:ParticleDef)
function add_particlespawner(def:ParticleSpawnerDef):number
function delete_particlespawner(id:number, player:PlayerRef=nil)
function create_schematic(p1:Vec3, p2:Vec3, probability_list:table, \
filename:string, slice_prob_list:table)
function place_schematic(pos:Vec3, schematic:Schematic|string, \
rotation:SchematicRotation, replacements:table, \
force_placement:boolean)
function serialize_schematic(schematic:Schematic|string, \
format:SchematicFormat, \
options:SerializeSchematicOptions):string
function get_connected_players():array<PlayerRef>
function hash_node_position(pos:Vec3):number
function get_position_from_hash(hash:number):Vec3
function get_item_group(name:string, group:string):number
function get_node_group(name:string, group:string):number
function raillike_group(name:string):number
function get_content_id(name:string):number
function get_name_from_content_id(content_id:number):string
function parse_json(json:string, nullvalue:any=nil):any
function write_json(data:table, styled:boolean=false):string
function serialize(t:table):string
function deserialize(s:string):table
function compress(data:string, method:CompressionMethod, ...):string
function decompress(compressed_data:string, \
method:CompressionMethod, ...):string
function is_protected(pos:Vec3, name:string):boolean
function record_protection_violation(pos:Vec3, name:string)
function rotate_and_place(itemstack:ItemStack, placer:ObjectRef, \
pointed_thing:PointedThing, \
infinitestacks:boolean=false, \
orient_flags:RnPOrientFlags=nil)
function rotate_node(itemstack:ItemStack, placer:ObjectRef, \
pointed_thing:PointedThing)
function forceload_block(pos:Vec3):boolean
function forceload_free_block(pos:Vec3)
function request_insecure_environment():table
function global_exists(name:string):boolean
end
namespace default
var LIGHT_MAX:number=15
function player_set_animation()
function player_set_textures()
function register_player_model()
function node_sound_leaves_defaults()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment