123456789101112131415161718192021222324 |
- -- lightning: https://github.com/minetest-mods/lightning
- minetest.register_craftitem("witchcraft:scroll_lightning", {
- description = "Scroll of lightning",
- inventory_image = "witchcraft_scroll.png^witchcraft_thunder_over.png",
- stack_max = 1,
- on_use = function(item, placer, pos)
- local playerpos = placer:getpos();
- local dir = placer:get_look_dir();
- lightning.strike({x=playerpos.x+dir.x*2,y=playerpos.y+0+dir.y,z=playerpos.z+dir.z*2})
- item:take_item()
- return item
- end,
- })
- minetest.register_craft({
- output = 'witchcraft:scroll_lightning',
- recipe = {
- {'default:steel_ingot'},
- {'default:diamond'},
- {'witchcraft:scroll'},
- }
- })
|