Initial commit — Minecraft AI God plugin

- mc_aigod.py: main watcher script (log tail, RCON, two-call LLM)
- Two-call LLM split: qwen3-coder:30b for commands, gemma3:12b for messages
- Divine intervention timer (Poisson process, configurable avg/day)
- Prayer memory (persistent, last 10 exchanges)
- Rolling server log context (last 20 min events)
- Live player context (inventory with rarity, health, food, pos, XP)
- /pray and bible chat detection (no slash — vanilla 1.21 compatible)
- Login notice, bible help system
- debug_commands toggle (in-game command display via tellraw)
- Auto-fix for transposed give command syntax
- JSON repair fallback for truncated LLM responses
- Sentence-aware message chunking for long responses
- mc-aigod.service systemd unit
- mc_aigod_shrink.json example config
- README.md full implementation guide
- Minecraft_Ai_God.md full design document
This commit is contained in:
2026-03-15 19:02:16 -04:00
commit 8ee8be9cc0
27 changed files with 3264 additions and 0 deletions
@@ -0,0 +1 @@
{"values": ["shrinkborder:load"]}
@@ -0,0 +1 @@
{"values": ["shrinkborder:tick"]}
@@ -0,0 +1,5 @@
# Check if total deaths increased since last tick
execute unless score $deaths_total deaths_total = $deaths_prev deaths_prev run function shrinkborder:on_death
# Update previous death count
scoreboard players operation $deaths_prev deaths_prev = $deaths_total deaths_total
@@ -0,0 +1,2 @@
scoreboard players set $shrink_enabled shrink_enabled 0
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"Border shrinking is now ","color":"white"},{"text":"DISABLED","color":"red"},{"text":".","color":"gray"}]
@@ -0,0 +1,5 @@
scoreboard players set $shrink_enabled shrink_enabled 1
scoreboard players set $deaths_total deaths_total 0
execute as @a run scoreboard players operation $deaths_total deaths_total += @s player_deaths
scoreboard players operation $deaths_prev deaths_prev = $deaths_total deaths_total
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"Border shrinking is now ","color":"white"},{"text":"ENABLED","color":"green"},{"text":"! Die and the walls close in.","color":"gray"}]
@@ -0,0 +1,18 @@
# Initialise scoreboards on world load
scoreboard objectives add deaths_total dummy "Total Deaths"
scoreboard objectives add deaths_prev dummy "Previous Deaths"
scoreboard objectives add border_parity dummy "Border Parity"
scoreboard objectives add shrink_enabled dummy "Shrink Enabled"
scoreboard objectives add player_deaths deathCount
# Set shrink feature to DISABLED by default
scoreboard players set $shrink_enabled shrink_enabled 0
# Initialise parity tracker (0=shrink N/S, 1=shrink E/W)
scoreboard players set $border_parity border_parity 0
# Set world border
worldborder center 0 0
worldborder set 1000
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"Loaded. Shrinking is ","color":"white"},{"text":"DISABLED","color":"red"},{"text":". Use /function shrinkborder:enable to start.","color":"gray"}]
@@ -0,0 +1,12 @@
# A death occurred - shrink the border by 1 on alternating axes
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"A player died! Border shrinking...","color":"red"}]
# Even deaths: shrink N/S
execute if score $border_parity border_parity matches 0 run function shrinkborder:shrink_ns
# Odd deaths: shrink E/W
execute if score $border_parity border_parity matches 1 run function shrinkborder:shrink_ew
# Flip parity
execute if score $border_parity border_parity matches 0 run scoreboard players set $border_parity border_parity 1
execute if score $border_parity border_parity matches 1 run scoreboard players set $border_parity border_parity 0
@@ -0,0 +1,5 @@
scoreboard players set $shrink_enabled shrink_enabled 0
scoreboard players set $border_parity border_parity 0
worldborder center 0 0
worldborder set 1000
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"Border reset to 1000x1000 and shrinking DISABLED.","color":"green"}]
@@ -0,0 +1,2 @@
worldborder add -1 1
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"East wall closed in. ","color":"yellow"},{"text":"Stay inside!","color":"red"}]
@@ -0,0 +1,2 @@
worldborder add -1 1
tellraw @a ["",{"text":"[ShrinkBorder] ","color":"gold"},{"text":"North wall closed in. ","color":"yellow"},{"text":"Stay inside!","color":"red"}]
@@ -0,0 +1,6 @@
# Run every tick - count total deaths across all players
scoreboard players set $deaths_total deaths_total 0
execute as @a run scoreboard players operation $deaths_total deaths_total += @s player_deaths
# Only process if shrinking is enabled
execute if score $shrink_enabled shrink_enabled matches 1 run function shrinkborder:check_deaths
+6
View File
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 26,
"description": "Shrinking border on death"
}
}