In order to use it, just install it in your preferred mods folder and add it as a dependency to your mod. There, you'll be able to use these functions however you please. With it, you'll be able to easily make changes to any mobs you please without needing to worry about
Example override:
Code: Select all
--Give dirt monsters a lot less maximum hp, but give them a ranged attack.
entitycontrol.override_entity("mobs_monster:dirt_monster",
{
hp_max = 15,
attack_type = "dogshoot",
dogshoot_switch = 1,
dogshoot_count_max = 1, -- shoot for 1 second
dogshoot_count2_max = 3, -- dogfight for 3 seconds while waiting between shots
shoot_interval = 3,
arrow = "modname:dirt_shot",
shoot_offset = 1,
})
mobs:register_arrow("modname:dirt_shot", {
visual = "sprite",
visual_size = {x = 0.5, y = 0.5},
textures = {"default_dirt.png"},
velocity = 6,
expire = 0.1,
--Low damage hits
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
--Turns nodes into dirt
hit_node = function(self, pos, node)
minetest.set_node(pos, {name="default:dirt"})
end
})
Repository: https://github.com/Noodlemire/entitycontrol
License: Apache 2.0, https://github.com/Noodlemire/entitycon ... ICENSE.txt
Download: https://mega.nz/#!W25QmBiY!8RZA4IJjq4wG ... _11b-Y9mw0