Commit graph

543 commits

Author SHA1 Message Date
cora
a6a98fb7ae Fix crash when getting attacked by mob while in boat 2022-10-15 01:58:19 +02:00
epCode
f242655b13 make mobs predict jumps before even getting too close to a bock. 2022-10-15 01:47:43 +02:00
epCode
44ba08cb8b make die animation more smooth for all mobs 2022-10-15 01:47:43 +02:00
epCode
ba127ecb12 fine-tune mob velocity 2022-10-15 01:47:43 +02:00
epCode
82153c2af9 make mob movment more fluid 2022-10-15 01:47:43 +02:00
cora
d90b3c046a give mobs a slightly heigher jump height
so they don't need 2 tries to jump on a node
2022-10-14 02:44:23 +02:00
cora
c855f51829 fix mobs not jumping anymore 2022-10-14 02:40:25 +02:00
cora
c044cf8e74 Fix debug line 2022-10-14 02:31:23 +02:00
cora
93f8f2aa3b only count despawnable mobs for global caps 2022-10-14 02:31:23 +02:00
cora
976b9da7d7 Despawn out of range mobs when immobile 2022-10-14 02:31:23 +02:00
cora
c146124a2c spawning: check for room accrd. to collisionbox 2022-10-14 02:31:23 +02:00
cora
ea48be3f4c Add global and per-player mob caps 2022-10-14 02:31:23 +02:00
cora
cd862888d1 Fix indentation 2022-10-14 02:31:23 +02:00
cora
ba25e57eac don't run on_spawn twice 2022-10-14 02:31:23 +02:00
cora
546b9ade6f Make mobs outside of player radius stop moving 2022-10-14 02:31:23 +02:00
cora
5db7680cd1 mitigate high cpu usage due to excessive mob counting
This was caused by the mob caps being checked too frequently
2022-10-14 02:31:23 +02:00
cora
97f9614818 Log the node a mob spawns on 2022-10-14 02:31:23 +02:00
cora
cba176be4a make horny mobs move towards each other 2022-10-14 02:31:23 +02:00
cora
39a0353a49 Add spawn counts per mob to /mobstats 2022-10-14 02:31:23 +02:00
epCode
27ac333878 fix syntax crash 2022-10-13 16:59:32 -07:00
epCode
b27c81cea4 make mobs coordinate attacks with all other similar alliances. 2022-10-13 16:53:01 -07:00
epCode
12e9c2c6d0 make all hostile mobs attack a little more strategically. 2022-10-13 16:41:45 -07:00
cora
3e312af3b9 fix warning / wrong var 2022-10-14 00:09:32 +02:00
cora
b770ce42e3 Fix particlespawners not showing on player_transfer_distance == 0 2022-10-13 21:48:05 +00:00
cora
01791cf550 fix crash when player_transfer_distance is not set 2022-10-13 21:48:05 +00:00
cora
ef4b243a30 Add coord safe infinite particlespawners api for mobs 2022-10-13 21:48:05 +00:00
cora
a4a5b72380 Fix mobs not following player wielding the follow item 2022-10-13 15:03:24 +02:00
cora
0048a3edb2 Display egg if icon not available 2022-10-13 02:13:02 +02:00
cora
57b5d13edf Add setting to optionally bring back spawn icons 2022-10-13 02:13:02 +02:00
epCode
22a5856b46 make spawn_mob able to change values in a mob 2022-10-13 01:54:38 +02:00
epCode
aa2693795d Add Spider Jockey 2022-10-10 13:42:01 -07:00
epCode
8cd093afa9 adjust values 2022-10-09 18:43:41 -07:00
epCode
9cf5b2a9f6 make mobs rotate when punched 2022-10-09 18:40:41 -07:00
epCode
8a63e90e4a remove debug message 2022-10-09 18:26:20 -07:00
epCode
a16e8f0403 remove all glitchy shaking 2022-10-09 17:41:50 -07:00
epCode
090c5b086a fix mobs shaking a lot 2022-10-09 17:29:28 -07:00
epCode
c500dc98f9 fix only hostile mobs using smooth turning 2022-10-09 17:23:14 -07:00
epCode
4a086db4c5 get rid of unecessary "if true" statement 2022-10-10 00:09:06 +00:00
epCode
ef980f2ea0 Make mobs have smooth turning 2022-10-10 00:09:06 +00:00
Johannes Fritz
36427d5aef Check enable damage instead of creative mode in some cases 2022-10-09 21:45:05 +02:00
epCode
25cceb58a9 (+)blaze_head_rotation 2022-10-07 02:45:02 +00:00
epCode
690d97bc63 (+)zombie_head_rotation 2022-10-07 02:45:02 +00:00
epCode
5f46f9649a Make mobs not always look at you+looks at own kind 2022-10-07 02:45:01 +00:00
cora
609f90dd0a Use conditional set_bone_position for mob head swivel 2022-10-07 02:45:01 +00:00
epCode
1a6698abda Add api and following mobs as starers: cow, chicken, creeper, pig, sheep, skellys. spider, villager, villager_zombie, wolf 2022-10-07 02:45:01 +00:00
cora
d570a2dda6 Fix double despawn in staticdata/activate 2022-10-06 19:15:14 +02:00
PrairieWind
d8e2255d76 Added egg textures to register_egg function/api 2022-10-03 11:52:22 -06:00
Johannes Fritz
19c0851003 Add big head support to all babies 2022-09-29 12:03:50 -05:00
cora
9a95557ec8 Simplify within_limits function
so you don't need a cs degree to read it ^^
2022-09-19 13:56:39 +02:00
cora
df8c234def Check map limits before get_natural_light 2022-09-19 13:56:39 +02:00
cora
467ecc7c58 Remove 5.3 check for get_natural_light function
as 5.3 isn't supported anymore
2022-09-19 13:56:39 +02:00
cora
7f4443b76f Don't reset size for children 2022-09-16 18:22:09 +02:00
cora
ed8dc1d137 Move zombie visual size update to mcl_mobs 2022-09-16 18:22:09 +02:00
cora
611d8808ac Fix a variable typo causing crashes with prot. mod 2022-09-16 15:11:52 +02:00
cora
cb3b3b92cc Immobilize shulkers 2022-09-14 20:37:07 +00:00
cora
20a30f9f44 Instakill mobs on punch in creative 2022-09-13 16:52:53 +00:00
cora
8c16b8c7ee Make mob caps configurable 2022-09-13 14:18:29 +02:00
cora
87d4640ca1 mcl_mobs: actually use the localized functions
not that it actually gains *a lot*
2022-09-13 13:53:38 +02:00
cora
51e244fe35 Make logging of mob spawning configurable 2022-09-13 13:43:57 +02:00
cora
786cea122d Remove some unsused settings from mcl_mobs 2022-09-13 13:39:14 +02:00
PrairieWind
186059ae13 spawn_mob logging and pillager npc attack 2022-09-09 20:30:26 -06:00
cora
3093462ee3 Fix despawning 2022-09-10 01:56:37 +00:00
cora
97cab0d91f Use api spawn command for natural spawn 2022-09-10 01:56:37 +00:00
cora
8c3ada1e11 Fix spawn command 2022-09-10 01:56:37 +00:00
cora
f629a6ba9d Only zombies attack villagers 2022-09-10 01:56:37 +00:00
cora
4bc6210fda disable smooth rotation 2022-09-10 01:56:37 +00:00
cora
962425faa5 Don't spawn structure mobs in peaceful mode 2022-09-07 11:58:16 +02:00
PrairieWind
fc362f0e9c Add Loggin Actions to mob spawning, and fixed log message for spawn egg use 2022-09-02 10:06:10 +00:00
cora
77e11713d3 Remove superfluous bed check for villagers 2022-08-30 21:52:47 +02:00
cora
2f0ca063e9 Make monsters less likely to spawn in groups 2022-08-30 21:52:47 +02:00
cora
3993cddfc6 Check for conditions on each group spawn 2022-08-30 21:52:47 +02:00
cora
683ace0748 Fix crash when using flint and steel on creeper 2022-08-28 21:10:48 +02:00
cora
ccfbc7da14 Make sure math.random gets a >0 argument 2022-08-24 03:01:32 +02:00
Johannes Fritz
181eb96c6d Fix up pillagers 2022-08-16 01:53:42 +02:00
cora
f27b2d9714 Fix 'spawn_in_group_min' warning 2022-08-15 11:58:39 +02:00
iliekprogrammar
bf80074d98
[5.6][mobs] fix unsafe entity handling (unsure)
i'm not sure about this one, can't find a suitable test for it.
2022-08-07 12:38:26 +08:00
iliekprogrammar
221ee0fcf1
[5.6] mark places with unsafe set_hp entity handling
There might be other places i might be missing, but these are the obvious ones.

leftover entity handling i did not mark:
* everything that involves a apply()-like algorithm (e.g. callbacks) over the
  same list of objects.
* in mcl_damage, it's not known whether mcl_damage.from_mt() would involve
  entity handling or just player handling.
2022-08-07 00:13:03 +08:00
cora
51f79eaa39 Add lilypads and dead bushes 2022-08-02 12:02:20 +02:00
cora
94f0d679f2 Add can_spawn callback in mob api 2022-07-22 03:27:41 +02:00
cora
32ac2ffeb8 remove unused alias_mob function 2022-07-22 03:27:41 +02:00
Sumyjkl
68e1fdde36 fixed comment about creative 2022-07-22 03:27:41 +02:00
Sumyjkl
fbfc53ff42 eat sound will play even when feeding in creative 2022-07-22 03:27:41 +02:00
Sumyjkl
3852c0297f changed API to recognise sitting order, added animations for sitting and idle, dog will no longer walk around while in sit mode 2022-07-22 03:27:41 +02:00
cora
b7a0460b15 Reset aggro when player far 2022-07-22 03:27:41 +02:00
SumianVoice
cfb6b6003c Update api.lua 2022-07-22 03:27:41 +02:00
SumianVoice
a6eae1e95e don't tame baby animals yet 2022-07-22 03:27:41 +02:00
SumianVoice
682b61ad4a make sure you can't heal and tame at the same time 2022-07-22 03:27:41 +02:00
SumianVoice
524da8a6cb move heal under tame so that you can tame an animal and then heal it, like in MC 2022-07-22 03:27:41 +02:00
SumianVoice
e6a97031ef remove unnecessary check 2022-07-22 03:27:41 +02:00
SumianVoice
120b096fc8 move self.food check 2022-07-22 03:27:41 +02:00
SumianVoice
9d52fed357 non-tamable mobs will not send tame param to feed_tame func,
changed event flow so it tries in order: heal, tame, breed, grow child
2022-07-22 03:27:41 +02:00
SumianVoice
e5c1da4380 make it check not child, since the return statement was removed 2022-07-22 03:27:41 +02:00
SumianVoice
a07a5b24bd animals don't take food from player unless it is used for something 2022-07-22 03:27:41 +02:00
SumianVoice
c626c977d1 Update api.lua 2022-07-22 03:27:41 +02:00
cora
bf756403a3 Fix animals attacking players for no reason 2022-07-18 00:10:23 +00:00
cora
99037cb0ec adapt several mob spawning conditions to mc 2022-07-18 00:10:23 +00:00
cora
1087d9e54b Implement mc like mob cap 2022-07-18 00:10:23 +00:00
cora
2d3f4531c9 Add mob spawning debug command 2022-07-18 00:10:23 +00:00
cora
987ae3c6e8 Fix mobs spawning inside nodes 2022-07-18 00:10:23 +00:00
cora
3a32e4e4e9 Never spawn mobs on bedrock 2022-07-18 00:10:23 +00:00
cora
a68343b71d Add group spawning minimum attribute 2022-07-18 00:10:23 +00:00
cora
a077e4535f Fix non-monsters being unable to attack
A check in the relevant function excluded all non-monsters from
looking for targets to attack. This removes that check and relies
on the passive attribute of the entity
2022-07-18 00:10:23 +00:00
cora
ee9cc5341b Fix villager crash when opening iron doors 2022-07-15 22:11:07 +00:00
cora
aab3180269 clear empty nametag as well as nil 2022-07-15 04:40:12 +02:00
cora
9e60d24fe0 Never spawn mobs on leaves 2022-07-13 16:45:41 +02:00
cora
c1686923d3 Fix crash when no group spawning positions found 2022-07-11 22:31:35 +02:00
cora
f202ed8327 spawn in groups 2022-07-09 02:30:48 +02:00
cora
ae0eb85ffc Add salmon, cod and dolphin from mcl5 2022-07-09 02:30:48 +02:00
cora
de9056ae62 Fix child mobs collision boxes 2022-07-08 23:57:02 +02:00
cora
08a1ecd879 Don't take extra bread when feeding 2022-07-08 23:57:02 +02:00
cora
672b9dbedf make pathfinding to jobsite more smooth 2022-07-05 23:47:30 +02:00
cora
b1c97a0510 prevent ground squids, variable spawn height 2022-07-04 01:41:45 +02:00
cora
8efbd89b6a Add basalt columns & lava pools 2022-06-19 00:24:52 +02:00
cora
e630ea59c9 Rate limit pathfinding attempts
In certain situation it otherwise results in excessive attempts to
find a path.
2022-06-17 15:54:53 +02:00
cora
8651e3b04e randomize spawning list 2022-06-15 05:06:31 +02:00
cora
a43627e268 Fix 2 wrong variable uses that made warnings 2022-06-12 01:35:27 +00:00
MysticTempest
45ec876167 Knockback fixes:
This PR enables knockback for snowballs, and eggs.
And disables knockback for the following mobs: Shulkers, Iron Golems,
and Ender Dragons.
2022-06-07 02:55:19 -05:00
cora
86bc398a79 don't do flying animation while perching,fix anims 2022-05-28 00:05:04 +02:00
cora
47fa43825c count only mobs for cramming 2022-05-26 14:20:19 +02:00
cora
af7dc0fb8f change "constant" declaration to match mcl_mobs 2022-05-26 14:16:38 +02:00
cora
87f50d6423 entity cramming: clean up check logic 2022-05-26 14:16:38 +02:00
cora
fb4f21cba0 entity cramming: spare the children 2022-05-26 14:16:38 +02:00
cora
85b599edba entity cramming: check less often 2022-05-26 14:16:38 +02:00
cora
b4cbc528a3 mcl_mobs: add entity_cramming 2022-05-26 14:16:38 +02:00
Elias Fleckenstein
f6a40ffb78
Run tools/strip_trailing_whitespace.sh 2022-05-26 07:29:28 +02:00
Elias Fleckenstein
ff33794487 Rename mobs global to mcl_mobs 2022-05-25 23:13:33 +02:00
Elias Fleckenstein
e0f70b54ec Remove _cmi_is_mob 2022-05-25 23:13:33 +02:00
Elias Fleckenstein
4054f05a4c Remove support for invisibility mod 2022-05-25 23:13:33 +02:00
Elias Fleckenstein
f6be8bac5a Remove checks for MCL2 mods 2022-05-25 23:13:33 +02:00
Elias Fleckenstein
8db9e76529 Remove unused version field 2022-05-25 23:13:33 +02:00
Elias Fleckenstein
6ae722a6ee Remove use_cmi 2022-05-25 23:13:33 +02:00
Elias Fleckenstein
fc3992ceb6 Remove mobs.is_creative 2022-05-25 23:13:33 +02:00
cora
5dafeaadc6 Fix indentation in mcl_mobs/api.txt 2022-05-21 12:36:57 +02:00
cora
53df441c1b Don't pick up near player, add more breeding stuff 2022-05-21 12:36:57 +02:00
cora
db865ede56 villagers open doors in daytime and close at night 2022-05-21 12:36:57 +02:00
cora
67939f7b7a pathfinding: find doors close to target as well 2022-05-21 12:36:57 +02:00
cora
9ccbf91706 mobs api: document api additions 2022-05-21 12:36:57 +02:00
cora
dfb74cf9e9 mobs: add nofollow option so v. dont follow bread 2022-05-21 12:36:57 +02:00
cora
e6b65af3b4 add mobs item pickup 2022-05-21 12:36:57 +02:00
cora
4ac41a793e fix two crashes in pathfinding 2022-05-21 12:36:57 +02:00
cora
98231f15ae change function name go_wplist -> gopath 2022-05-21 12:36:57 +02:00
cora
f8fc111b4a pathfind to jobsites 2022-05-21 12:36:57 +02:00
cora
dbc5564d02 move movement code to mcl_mobs 2022-05-21 12:36:57 +02:00
cora
5282a63bcb add options for nametagged mobs and range 2022-05-15 20:04:09 +00:00
cora
e5de4bba65 keep nametagged mobs, add "all" argument 2022-05-15 20:04:09 +00:00
cora
628686ce79 Add a command to safely remove all mob objects 2022-05-15 20:04:09 +00:00
cora
e1ed990f58 sp. farm animals on grass, villagers near beds 2022-05-08 18:50:37 +00:00
kay27
53042b6f48 Adopt mob spawning from mcl5 2022-05-08 18:50:37 +00:00
NO411
e790bf90f4 Make shields work with all mobs 2022-04-09 16:21:22 +02:00
cora
1c9f0c3238 don't spawn mobs on non opaque nodes or leaves
with the preliminary jordanspaning mobs would spawn on trees
and water regularly.
2022-03-22 22:02:15 +01:00