From 962a13847e64613e53f1a2542860d3439a9a6d4f Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Tue, 6 Apr 2021 14:57:29 +0200 Subject: [PATCH] Fix dragons summoned using commands spawning an egg on the exit portal --- mods/ENTITIES/mobs_mc/ender_dragon.lua | 4 ++-- mods/ITEMS/mcl_end/end_crystal.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index 509409a2e2..01c3465796 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -63,9 +63,9 @@ mobs:register_mob("mobs_mc:enderdragon", { mcl_bossbars.update_boss(self, "Ender Dragon", "light_purple") end, on_die = function(self, pos) - if not self._respawned then + if self._portal_pos then mcl_experience.throw_experience(pos, 11500) -- 500 + 11500 = 12000 - minetest.set_node(self._portal_pos and minetest.string_to_pos(self._portal_pos) or vector.add(mcl_vars.mg_end_platform_pos, vector.new(-27, 2, 0)), {name = mobs_mc.items.dragon_egg}) + minetest.set_node(minetest.string_to_pos(self._portal_pos), {name = mobs_mc.items.dragon_egg}) end end, fire_resistant = true, diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index 8fcf67a1d6..9e4fa13fd6 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -58,7 +58,7 @@ local function spawn_crystal(pos) for _, crystal in pairs(crystals) do crystal_explode(crystal) end - minetest.add_entity(vector.add(portal_center, {x = 0, y = 10, z = 0}), "mobs_mc:enderdragon"):get_luaentity()._respawned = true + minetest.add_entity(vector.add(portal_center, {x = 0, y = 10, z = 0}), "mobs_mc:enderdragon") end minetest.register_entity("mcl_end:crystal", {