mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-20 09:53:46 +01:00
5% chance spawn endermite after using ender pearl
This commit is contained in:
parent
7d2ffe1c92
commit
1b7b43551e
@ -251,9 +251,17 @@ local pearl_on_step = function(self, dtime)
|
||||
end
|
||||
end
|
||||
|
||||
local oldpos = player:getpos()
|
||||
-- Teleport and hurt player
|
||||
player:setpos(telepos)
|
||||
player:set_hp(player:get_hp() - 5)
|
||||
|
||||
-- 5% chance to spawn endermite at the player's origin
|
||||
local r = math.random(1,20)
|
||||
if r == 1 then
|
||||
minetest.add_entity(oldpos, "mobs_mc:endermite")
|
||||
end
|
||||
|
||||
end
|
||||
self.object:remove()
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user