forked from VoxeLibre/VoxeLibre
Compare commits
1 Commits
master
...
enderdebug
Author | SHA1 | Date |
---|---|---|
|
d60fa0f4ab |
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
local S = minetest.get_translator("mobs_mc")
|
local S = minetest.get_translator("mobs_mc")
|
||||||
|
|
||||||
|
local enderdebug = false
|
||||||
|
|
||||||
local telesound = function(pos, is_source)
|
local telesound = function(pos, is_source)
|
||||||
local snd
|
local snd
|
||||||
if is_source then
|
if is_source then
|
||||||
|
@ -391,11 +393,18 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
|
||||||
--if looking in general head position, turn hostile
|
--if looking in general head position, turn hostile
|
||||||
if minetest.line_of_sight(ender_eye_pos, look_pos_base) and vector.distance(look_pos, ender_eye_pos) <= 0.4 then
|
if minetest.line_of_sight(ender_eye_pos, look_pos_base) and vector.distance(look_pos, ender_eye_pos) <= 0.4 then
|
||||||
self.provoked = "staring"
|
self.provoked = "staring"
|
||||||
|
if not enderdebug then
|
||||||
self.attack = minetest.get_player_by_name(obj:get_player_name())
|
self.attack = minetest.get_player_by_name(obj:get_player_name())
|
||||||
|
else
|
||||||
|
minetest.log("staring")
|
||||||
|
end
|
||||||
break
|
break
|
||||||
else -- I'm not sure what this part does, but I don't want to break anything - jordan4ibanez
|
else -- I'm not sure what this part does, but I don't want to break anything - jordan4ibanez
|
||||||
if self.provoked == "staring" then
|
if self.provoked == "staring" then
|
||||||
self.provoked = "broke_contact"
|
self.provoked = "broke_contact"
|
||||||
|
if enderdebug then
|
||||||
|
minetest.log("stopped staring")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -778,3 +787,15 @@ mcl_vars.mg_nether_max)
|
||||||
|
|
||||||
-- spawn eggs
|
-- spawn eggs
|
||||||
mcl_mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)
|
mcl_mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)
|
||||||
|
|
||||||
|
minetest.register_chatcommand("enderdebug",{
|
||||||
|
description = S("Toggle between enderman aggro behavior and just signal staring"),
|
||||||
|
privs = { debug = true },
|
||||||
|
func=function()
|
||||||
|
enderdebug = not enderdebug
|
||||||
|
if enderdebug then
|
||||||
|
return true, "Endermen will not attack"
|
||||||
|
end
|
||||||
|
return true, "Endermen back to normal"
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue