Light up the wielded item - a Minetest mod
Clone or download
bell07 use setmetatable instead of table copy
like in minetest game / default dropped item
Latest commit 791ebfa Jan 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Jan 10, 2018
README.md added dropped items shining May 8, 2018
init.lua use setmetatable instead of table copy Jan 10, 2019
mod.conf initial commit Jan 10, 2018
screenshot.png initial commit Jan 10, 2018

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