I really appreciate the concept of your "ai_players" mod! However, I identified a few critical structural bugs causing game crashes and performance degradation. Here is my diagnostic analysis and proposed fixes:
1. Initialization Crash (Nil Value)
Placing the AI spawn egg halts the engine because on_activate attempts to call player_api.get_animation_mesh("model"), which doesn't exist in the standard dependency.
Fix: Safely remove this conditional block. The 3D mesh (character.b3d) is already successfully defined within initial_properties.
2. Data Amnesia & Inventory Memory Leaks
Although your entity serializes its state via get_staticdata, on_activate never reads this data back, causing the bot to reset to "Friend" upon reloading. Furthermore, its internal inventory ID is hardcoded to its exact X/Z coordinates. If the bot moves, reloading generates a completely new inventory matrix in the server's memory—erasing given items and infinitely spawning new bread units.
3. The Infinite Iron Loop (CPU Asphyxiation)
The iron_block_generator uses minetest.get_objects_inside_radius to detect nearby entities. Because the engine catalogs dropped items as entities, the very first dispensed iron ingot triggers the condition to drop more iron, creating an endless feedback loop.
Fix: Apply a filter to verify that the detected object is strictly a player (obj:is_player()) or a valid mob.
4. Protection Bypass (Griefing Vulnerability)
The AI's mining system executes minetest.dig_node but never evaluates if the terrain belongs to another player. This allows the entity to destroy protected architectures on multiplayer servers.
Fix: Wrap the digging instruction inside a minetest.is_protected conditional check.
Thank you for your hard work—these quick fixes will make the mod incredibly stable!
Title: 🚨 Bug Report: Engine Crash, Runaway Farms & Memory Leaks in ai_players v2.0
Hello Jazzlagamer,
I really appreciate the concept of your "ai_players" mod! However, I identified a few critical structural bugs causing game crashes and performance degradation. Here is my diagnostic analysis and proposed fixes:
1. Initialization Crash (Nil Value) Placing the AI spawn egg halts the engine because
on_activateattempts to callplayer_api.get_animation_mesh("model"), which doesn't exist in the standard dependency. Fix: Safely remove this conditional block. The 3D mesh (character.b3d) is already successfully defined withininitial_properties.2. Data Amnesia & Inventory Memory Leaks Although your entity serializes its state via
get_staticdata,on_activatenever reads this data back, causing the bot to reset to "Friend" upon reloading. Furthermore, its internal inventory ID is hardcoded to its exact X/Z coordinates. If the bot moves, reloading generates a completely new inventory matrix in the server's memory—erasing given items and infinitely spawning new bread units.3. The Infinite Iron Loop (CPU Asphyxiation) The
iron_block_generatorusesminetest.get_objects_inside_radiusto detect nearby entities. Because the engine catalogs dropped items as entities, the very first dispensed iron ingot triggers the condition to drop more iron, creating an endless feedback loop. Fix: Apply a filter to verify that the detected object is strictly a player (obj:is_player()) or a valid mob.4. Protection Bypass (Griefing Vulnerability) The AI's mining system executes
minetest.dig_nodebut never evaluates if the terrain belongs to another player. This allows the entity to destroy protected architectures on multiplayer servers. Fix: Wrap the digging instruction inside aminetest.is_protectedconditional check.Thank you for your hard work—these quick fixes will make the mod incredibly stable!