@SFENCE - Currently the only arrow movement flag is setting 'homing' to true in mob definition so it follows the player when in sight. I'll need to have a good think about alternative flags for controlling arrow movement and offset.
@Nininik - The mobs:drive on line:81 can be changed to mobs.drive(self, "walk", "stand", true, dtime) so that jumping makes you fly upwards and sneak makes you fly downwards.
@SFENCE - Currently the only arrow movement flag is setting 'homing' to true in mob definition so it follows the player when in sight. I'll need to have a good think about alternative flags for controlling arrow movement and offset.
Sure. My attempt now is to add some kind of imprecision to arrow.
function on_projectile_fired(obj)
local vel = obj:get_velocity()
local speed = vector.length(vel)
local rot = {
x = math.random() * math.pi * imprecision_coef,
y = math.random() * math.pi * imprecision_coef,
z = 0,
}
local new_dir = vector.rotate(vector.normalize(vel), rot)
obj:set_velocity(vector.multiply(new_dir, speed))
end
arrow_override = function(self)
self.velocity = 6
self.damage = 3
core.after(0.1, function(self) -- wait a fraction for arrow to begin then change direction
if not obj then return end -- just to be sure it's still there
local vel = self.object:get_velocity()
local imprecision_coef = 0.1
local speed = vector.length(vel)
local rot = {
x = math.random() * math.pi * imprecision_coef,
y = math.random() * math.pi * imprecision_coef,
z = 0,
}
local new_dir = vector.rotate(vector.normalize(vel), rot)
self.object:set_velocity(vector.multiply(new_dir, speed))
end, self)
end
- Add 'can_spawn_protect' flag to mobs:register_egg so that certain mobs can be spawned inside protected areas.
- Set above setting to True for mob_horse so players can spawn their horses in protected areas to ride.
AsyncErr: Lua: Runtime error from mod 'pmobs' in callback luaentity_Step(): "Invalid vector (expected table got number)."
stack traceback:
[C]: in function 'punch'
/home/serfdon/.minetest/mods/pmobs/ninja.lua:73: in function 'hit_mob'
/home/serfdon/.minetest/mods/mobs/api.lua:3892: in function </home/serfdon/.minetest/mods/mobs/api.lua:3810>
Last edited by Blockhead on Sat Jan 17, 2026 01:35, edited 1 time in total.
Reason:icode->code
The original post isnt mine to update unfortunately, I could only add a new link as the last post.
Can't they give the thread to you? You are the mob man. Or you could start a new thread for it.
As a forum mod, it would depend on if TenPlus1 forked pmobs or is considered the successor maintainer to CProgrammerRu. If it's a fork, I'd rather TenPlus1 starts a new thread and we move the old one to Old Mods.