forked from Mirrorlandia_minetest/mod-sneeker
Use 'spawneggs' & 'tnt' to craft 'creeper:spawnegg'
This commit is contained in:
parent
84f6c2f3c9
commit
9d4581ec5b
38
init.lua
38
init.lua
@ -342,19 +342,29 @@ end
|
||||
|
||||
minetest.register_entity("creeper:creeper",def)
|
||||
|
||||
minetest.register_craftitem("creeper:spawnegg",{
|
||||
description = "Creeper Spawn Egg",
|
||||
inventory_image = "creeper_spawnegg.png",
|
||||
stack_max = 64,
|
||||
on_place = function(itemstack,placer,pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
local pos = pointed_thing.above
|
||||
pos.y = pos.y+1
|
||||
minetest.add_entity(pos,"creeper:creeper")
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
if minetest.global_exists("spawneggs") then
|
||||
minetest.register_craftitem("creeper:spawnegg",{
|
||||
description = "Creeper Spawn Egg",
|
||||
inventory_image = "creeper_spawnegg.png",
|
||||
stack_max = 64,
|
||||
on_place = function(itemstack,placer,pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
local pos = pointed_thing.above
|
||||
pos.y = pos.y+1
|
||||
minetest.add_entity(pos,"creeper:creeper")
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "creeper:spawnegg",
|
||||
type = "shapeless",
|
||||
recipe = {"spawneggs:egg", "tnt:tnt",},
|
||||
})
|
||||
|
||||
minetest.register_alias("spawneggs:creeper", "creeper:spawnegg")
|
||||
end
|
||||
|
1
mod.conf
1
mod.conf
@ -3,3 +3,4 @@ title = Creeper
|
||||
description = Adds some explosive nuisance.
|
||||
author = Rui
|
||||
depends = default, tnt
|
||||
optional_depends = spawneggs
|
||||
|
Loading…
Reference in New Issue
Block a user