mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-08-23 09:40:26 +02:00
Compare commits
28 Commits
0156e04ebd
...
f576947d41
Author | SHA1 | Date | |
---|---|---|---|
f576947d41 | |||
f32b69a654 | |||
bd06ad8d6e | |||
8ce8490e78 | |||
18906fafeb | |||
9928b0e35e | |||
99fe3d0ce1 | |||
00e8ac0850 | |||
f98d769e15 | |||
928f8c5479 | |||
32e8d069f7 | |||
e4198b2a21 | |||
f11b774c95 | |||
8b25ab4988 | |||
064b59f01d | |||
a934d80631 | |||
f2cc0446b0 | |||
bff313267b | |||
9b0ff17101 | |||
dde9896a1a | |||
92c899e6a4 | |||
4634288124 | |||
610cef16f4 | |||
9c60e96336 | |||
dc3ed1dfe3 | |||
ff4bb540e1 | |||
9f5e6eb85f | |||
ad5b444b65 |
7
api.txt
7
api.txt
@ -45,6 +45,7 @@ functions needed for the mob to work properly which contains the following:
|
||||
'fly' when true allows your mob to fly around instead of walking.
|
||||
'fly_in' holds the node name that the mob flies (or swims) around
|
||||
in e.g. "air" or "default:water_source".
|
||||
'keep_flying' when true mobs like birds no longer stop and stand.
|
||||
'stay_near' when set allows mobs the chance to stay around certain nodes.
|
||||
'nodes' string or table of nodes to stay nearby e.g. "farming:straw"
|
||||
'chance' chance of searching for above node(s), default is 10.
|
||||
@ -67,7 +68,8 @@ functions needed for the mob to work properly which contains the following:
|
||||
level is between the min and max values below
|
||||
'light_damage_min' minimum light value when mob is affected (default: 14)
|
||||
'light_damage_max' maximum light value when mob is affected (default: 15)
|
||||
'suffocation' when true causes mobs to suffocate inside solid blocks.
|
||||
'suffocation' when > 0 mobs will suffocate inside solid blocks and will be
|
||||
hurt by the value given every second (0 to disable).
|
||||
'floats' when set to 1 mob will float in water, 0 has them sink.
|
||||
'follow' mobs follow player when holding any of the items which appear
|
||||
on this table, the same items can be fed to a mob to tame or
|
||||
@ -399,6 +401,8 @@ This function registers a arrow for mobs with the attack type shoot.
|
||||
'hit_mob' a function that is called when the arrow hits a mob;
|
||||
this function should hurt the mob, the parameters are
|
||||
(self, player)
|
||||
'hit_object' a function that is called when the arrow hits an object;
|
||||
this function parameters are (self, player)
|
||||
'hit_node' a function that is called when the arrow hits a node, the
|
||||
parameters are (self, pos, node)
|
||||
'tail' when set to 1 adds a trail or tail to mob arrows
|
||||
@ -628,6 +632,7 @@ External Settings for "minetest.conf"
|
||||
'mobs_griefing' when false mobs cannot break blocks when using either
|
||||
pathfinding level 2, replace functions or mobs:boom
|
||||
function.
|
||||
'mob_nospawn_range' Minimum range a mob can spawn near player (def: 12)
|
||||
|
||||
Players can override the spawn chance for each mob registered by adding a line
|
||||
to their minetest.conf file with a new value, the lower the value the more each
|
||||
|
@ -131,6 +131,10 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
-- make sure we can register fences
|
||||
if default.register_fence then
|
||||
|
||||
-- mob fence (looks like normal fence but collision is 2 high)
|
||||
default.register_fence("mobs:fence_wood", {
|
||||
description = S("Mob Fence"),
|
||||
@ -177,6 +181,9 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- items that can be used as fuel
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
@ -220,6 +227,7 @@ minetest.register_craft({
|
||||
burntime = 2
|
||||
})
|
||||
|
||||
|
||||
-- this tool spawns same mob and adds owner, protected, nametag info
|
||||
-- then removes original entity, this is used for fixing any issues.
|
||||
|
||||
|
25
mount.lua
25
mount.lua
@ -151,11 +151,13 @@ function mobs.attach(entity, player)
|
||||
}
|
||||
})
|
||||
|
||||
minetest.after(0.2, function()
|
||||
minetest.after(0.2, function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
default.player_set_animation(player, "sit" , 30)
|
||||
end)
|
||||
end
|
||||
end, player:get_player_name())
|
||||
|
||||
--player:set_look_yaw(entity.object:get_yaw() - rot_view)
|
||||
player:set_look_horizontal(entity.object:get_yaw() - rot_view)
|
||||
end
|
||||
|
||||
@ -168,11 +170,18 @@ function mobs.detach(player, offset)
|
||||
|
||||
local pos = player:get_pos()
|
||||
|
||||
pos = {x = pos.x + offset.x, y = pos.y + 0.2 + offset.y, z = pos.z + offset.z}
|
||||
pos = {
|
||||
x = pos.x + offset.x,
|
||||
y = pos.y + 0.2 + offset.y,
|
||||
z = pos.z + offset.z
|
||||
}
|
||||
|
||||
minetest.after(0.1, function()
|
||||
minetest.after(0.1, function(name, pos)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
player:set_pos(pos)
|
||||
end)
|
||||
end
|
||||
end, player:get_player_name(), pos)
|
||||
end
|
||||
|
||||
|
||||
@ -290,7 +299,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||
|
||||
-- Set position, velocity and acceleration
|
||||
local p = entity.object:get_pos()
|
||||
local new_velo = {x = 0, y = 0, z = 0}
|
||||
local new_velo
|
||||
local new_acce = {x = 0, y = -9.8, z = 0}
|
||||
|
||||
p.y = p.y - 0.5
|
||||
@ -315,7 +324,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||
minetest.sound_play("default_punch", {
|
||||
object = entity.object,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
}, true)
|
||||
|
||||
entity.object:punch(entity.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
|
@ -23,7 +23,8 @@ Lucky Blocks: 9
|
||||
|
||||
|
||||
Changelog:
|
||||
- 1.50 - Added new line_of_sight function that uses raycasting if mt5.0 is found (thanks Astrobe), dont spawn mobs if world anchor nearby (technic or simple_anchor mods), chinese local added
|
||||
- 1.51 - Added some node checks for dangerous nodes, jumping and falling tweaks, spawn area check (thx for idea wuzzy), re-enabled mob suffocation, add 'mob_nospawn_range' setting
|
||||
- 1.50 - Added new line_of_sight function that uses raycasting if mt5.0 is found, (thanks Astrobe), dont spawn mobs if world anchor nearby (technic or simple_anchor mods), chinese local added
|
||||
- 1.49- Added mobs:force_capture(self, player) function, api functions now use metatables thanks to bell07
|
||||
- 1.48- Add mobs:set_velocity(self, velocity) global function
|
||||
- 1.47- Mob damage changes, min and max light level for damage added, ignition sources checked for lava damage
|
||||
|
@ -27,3 +27,6 @@ mob_chance_multiplier (Mob chance multiplier) float 1.0
|
||||
|
||||
# When false Mob no longer drop items when killed
|
||||
mobs_drop_items (Mob drops) bool true
|
||||
|
||||
#....Sets minimum distance around player that mobs cannot spawn
|
||||
mob_nospawn_range (Mob no-spawn range) float 12.0
|
||||
|
Reference in New Issue
Block a user