mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 00:19:32 +01:00
5% chance spawn endermite after using ender pearl
This commit is contained in:
parent
7d2ffe1c92
commit
1b7b43551e
1 changed files with 8 additions and 0 deletions
|
@ -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 a new issue