diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-06-28 09:52:54 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-06-28 09:52:54 +0100 |
commit | 6799a7ac15f1e353b723a9b60fe355eb9b66fe26 (patch) | |
tree | 9595ebc6b211e98c74cbef9c7e133dddbb7d707b | |
parent | d74f2fa27bd322585a5d20fce762987bf4f9395c (diff) |
Added spawn_egg groups
-rw-r--r-- | api.lua | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -3051,14 +3051,18 @@ function mobs:register_arrow(name, def) end --- register spawn eggs +-- Register spawn eggs + +-- Note: This also introduces the “spawn_egg” group: +-- * spawn_egg=1: Spawn egg (generic mob, no metadata) +-- * spawn_egg=2: Spawn egg (captured/tamed mob, metadata) function mobs:register_egg(mob, desc, background, addegg, no_creative) - local grp = {} + local grp = {spawn_egg = 1} -- do NOT add this egg to creative inventory (e.g. dungeon master) if creative and no_creative == true then - grp = {not_in_creative_inventory = 1} + grp.not_in_creative_inventory = 1 end local invimg = background @@ -3073,7 +3077,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative) description = desc .. " (Tamed)", inventory_image = invimg, - groups = {not_in_creative_inventory = 1}, + groups = {spawn_egg = 2, not_in_creative_inventory = 1}, stack_max = 1, on_place = function(itemstack, placer, pointed_thing) |