Use asm_spawneggs to create egg
This commit is contained in:
parent
592e247c1c
commit
2603c721d2
29
init.lua
29
init.lua
@ -360,29 +360,16 @@ end
|
|||||||
|
|
||||||
core.register_entity(sneeker.mob_name, def)
|
core.register_entity(sneeker.mob_name, def)
|
||||||
|
|
||||||
if core.global_exists("spawneggs") then
|
if core.global_exists("asm") then
|
||||||
core.register_craftitem(sneeker.spawnegg_name, {
|
asm.addEgg({
|
||||||
description = "Sneeker Spawn Egg",
|
name = "sneeker",
|
||||||
inventory_image = "sneeker_spawnegg.png",
|
inventory_image = "sneeker_spawnegg.png",
|
||||||
stack_max = 64,
|
spawn = "sneeker:sneeker",
|
||||||
on_place = function(itemstack,placer,pointed_thing)
|
|
||||||
if pointed_thing.type == "node" then
|
|
||||||
local pos = pointed_thing.above
|
|
||||||
pos.y = pos.y+1
|
|
||||||
core.add_entity(pos, sneeker.mob_name)
|
|
||||||
if not core.settings:get_bool("creative_mode", false) then
|
|
||||||
itemstack:take_item()
|
|
||||||
end
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
||||||
core.register_craft({
|
core.register_alias(sneeker.spawnegg_name, "spawneggs:sneeker")
|
||||||
output = sneeker.spawnegg_name,
|
|
||||||
type = "shapeless",
|
|
||||||
recipe = {"spawneggs:egg", "tnt:tnt",},
|
|
||||||
})
|
|
||||||
|
|
||||||
core.register_alias("spawneggs:sneeker", sneeker.spawnegg_name)
|
if core.registered_items["tnt:tnt"] then
|
||||||
|
asm.addEggRecipe("sneeker", "tnt:tnt")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
2
mod.conf
2
mod.conf
@ -3,4 +3,4 @@ title = Sneeker
|
|||||||
description = An explosive nuisance.
|
description = An explosive nuisance.
|
||||||
author = Rui
|
author = Rui
|
||||||
depends = default, tnt
|
depends = default, tnt
|
||||||
optional_depends = spawneggs, nether
|
optional_depends = asm_spawneggs, nether
|
||||||
|
Loading…
Reference in New Issue
Block a user