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)
|
||||
|
||||
if core.global_exists("spawneggs") then
|
||||
core.register_craftitem(sneeker.spawnegg_name, {
|
||||
description = "Sneeker Spawn Egg",
|
||||
if core.global_exists("asm") then
|
||||
asm.addEgg({
|
||||
name = "sneeker",
|
||||
inventory_image = "sneeker_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
|
||||
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
|
||||
spawn = "sneeker:sneeker",
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
output = sneeker.spawnegg_name,
|
||||
type = "shapeless",
|
||||
recipe = {"spawneggs:egg", "tnt:tnt",},
|
||||
})
|
||||
core.register_alias(sneeker.spawnegg_name, "spawneggs:sneeker")
|
||||
|
||||
core.register_alias("spawneggs:sneeker", sneeker.spawnegg_name)
|
||||
if core.registered_items["tnt:tnt"] then
|
||||
asm.addEggRecipe("sneeker", "tnt:tnt")
|
||||
end
|
||||
end
|
||||
|
2
mod.conf
2
mod.conf
@ -3,4 +3,4 @@ title = Sneeker
|
||||
description = An explosive nuisance.
|
||||
author = Rui
|
||||
depends = default, tnt
|
||||
optional_depends = spawneggs, nether
|
||||
optional_depends = asm_spawneggs, nether
|
||||
|
Loading…
Reference in New Issue
Block a user