Use 'spawneggs' & 'tnt' to craft 'creeper:spawnegg'

This commit is contained in:
AntumDeluge 2017-05-13 03:42:48 -07:00 committed by Jordan Irwin
parent 84f6c2f3c9
commit 9d4581ec5b
2 changed files with 25 additions and 14 deletions

@ -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

@ -3,3 +3,4 @@ title = Creeper
description = Adds some explosive nuisance.
author = Rui
depends = default, tnt
optional_depends = spawneggs