Go to file
FaceDeer 601931c93f missed a few more local declarations 2021-03-13 17:56:57 -07:00
LICENSE Initial commit 2018-01-10 10:06:55 +01:00
README.md tidying up 2021-03-13 17:51:48 -07:00
init.lua missed a few more local declarations 2021-03-13 17:56:57 -07:00
mod.conf attempting to make this work with liquids 2020-07-11 16:15:07 -06:00
screenshot.png initial commit 2018-01-10 10:04:36 +01:00

README.md

wielded_light mod for Minetest

Idea taken from torches_wieldlight in https://github.com/minetest-mods/torches, but written from scratch and usable for all shining items.

Screenshot

All bright nodes with light value > 2 lighten the player environment if wielded, with value fewer by 2. (Torch 13->11 for example)

Dependencies: none

License: GPL-3

Shining API:

function wielded_light.update_light(pos, light_level) Enable or update the shining at pos with light_level for 0.6 seconds. Can be used in any on_step call to get other entitys shining for example

wielded_light.register_item_light(itemname, light_level) Override or set custom light level to an item. This does not change the item/node definition, just the lighting in this mod.

function wielded_light.update_light_by_item(stack, pos) Update light at pos using item shining settings -from registered item_light or from item definition

function wielded_light.register_lightable_node(light_def) Set nodes other than air or default water to be affected by this mod, allowing wielded lights to create a lit node when the player is inside it.

light_def = {
	lightable_nodes = -- a string or a list of strings giving the node names to make lightable (required)
	lit_by_floodable =  -- defaults to false, if true then items that are "floodable" (such as torches) will light this node when wielded
}