Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.5.0

The sidekick and the later parts of four specials.

- **The sidekick.** A critter with 10 hours out with you has a 1 in 10 chance each day of becoming your sidekick, rolled once a day while it's out. It comes out on its own when you join, change worlds or it's rested, doesn't count toward your posse, and stays when you click it in the Bunkhouse menu, use the menu's bell or ring the dinnerbell. One per player. Admins can set or clear it with `/mobsquad sidekick <player> <critter|none>`.
- **Time together** is counted per critter and saved as an eighth field on its line in the player's file; older files read as 0.
- **From level 25:** the chicken lays speedy eggs, the bee's sting makes hostile mobs glow, the fox pounces for a double first hit, and the skeleton shares arrows when you carry a bow or crossbow. Each gets stronger at the later milestones; see the README.
- Not yet: travelling with your sidekick through a gate (that waits for the Waystation hook) and the small model of your sidekick above the Bunkhouse.

## 0.4.0

La Ménagerie and the Critterbook.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@

Coax mobs into critters for Paper: they follow you, fight only hostile mobs, and live safely in a shared Bunkhouse. No client mods. Gotta coax em all... Pokemob!

**Status:** 0.4.0. La Ménagerie, the journal, with Critterbook numbers. Passed with bots on throwaway Paper 26.1.2 and 26.2 servers (147 checks each). On 26.3 the bots can't use blocks, so the Bunkhouse menu and everything sent out from it didn't run there (65 checks ran). Bots can't crouch where the server sees it, so the creeper and fox puzzles were tested with a test-only stand-in for crouching; real crouching is untested. The skeleton's longer range and the enderman's teleport out of trouble have no bot test yet. Nothing has been seen in a real game client yet, including how the journal looks.
**Status:** 0.5.0. The sidekick, and the later parts of four specials. Passed with bots on throwaway Paper 26.1.2 and 26.2 servers (164 checks each). On 26.3 the bots can't use blocks, so the Bunkhouse menu and everything sent out from it didn't run there (75 checks ran). Bots can't crouch where the server sees it, so the creeper and fox puzzles were tested with a test-only stand-in for crouching; real crouching is untested. The daily sidekick roll is covered by unit tests only, since it needs 10 hours out. Nothing has been seen in a real game client yet.

## What it does

- **Coaxing.** Each kind of mob has its own small puzzle, and you need its tier first. The chicken: walk it 10 blocks on a trail of seeds without running. The creeper: gunpowder starts a standoff; crouch while it swells, gunpowder when it calms, three times. The enderman: offer it a block, then stay near it for 20 seconds without looking it in the eye. `/mobsquad hints` lists all nine. Break a puzzle's rule and you start over. A mob being coaxed never turns on you, and after a failed try it leaves you alone for 10 seconds.
- **Fighting.** Critters fight hostile mobs only: the ones after you or your critters, and other hostile mobs near you that aren't neutral or named. They never hurt players, pets, villagers or farm animals. The skeleton shoots and the allay never fights.
- **Levels.** Each critter has its own level, 1 to 100. It earns experience for every hostile mob it helps beat (the mob's max health, so 20 for a zombie) and 2 for every minute out with you. Health, attack and speed grow a little each level and slow near the top: at level 100 a critter has four times its health, three times its attack and a fifth more speed. The Bunkhouse menu shows each critter's level, how far it is from the next and its special.
- **Specials.** Every critter has one, and it grows at levels 25, 50, 75 and 100.
- Chicken: you fall slowly while it's out.
- Chicken: you fall slowly while it's out. From level 25 it lays a speedy egg at your feet every 5 minutes (a minute sooner at each later milestone); right-click it for Speed II for 10 seconds, Speed III from level 75.
- Axolotl: water breathing and regeneration while you're within 6 blocks of it. It goes after drowned and guardians first, and plays dead and heals when it's badly hurt.
- Bee: crops near it grow faster, one crop a second.
- Fox: fetches items you drop or leave behind (drops from blocks you break and mobs you beat), after they've lain 5 seconds. It never touches anyone else's.
- Bee: crops near it grow faster, one crop a second. From level 25 its sting makes a hostile mob glow, so you can see it through walls.
- Fox: fetches items you drop or leave behind (drops from blocks you break and mobs you beat), after they've lain 5 seconds. It never touches anyone else's. From level 25 it pounces on a hostile mob that isn't after it, for a double first hit.
- Allay: right-click it holding an ore, a raw ore or a gem, and it flies to the nearest matching ore within 8 blocks of you.
- Creeper: a blast that hurts only the hostile mobs around its target and breaks nothing. It never goes off with a player within 6 blocks.
- Enderman: right-click it, then swing at a block within 8 blocks, and it fetches it for you. Only blocks an enderman can carry, and only where you could dig yourself, so claims say no. When it's badly hurt, it teleports to you.
- Skeleton: covering fire from 15 blocks, reaching further and shooting faster at each milestone.
- Skeleton: covering fire from 15 blocks, reaching further and shooting faster at each milestone. From level 25 it shares two arrows every 2 minutes while you carry a bow or crossbow.
- Iron golem: takes a quarter of any hostile mob's hit on you within 8 blocks, and throws the mobs it hits back.
- **La Ménagerie.** Your journal, with a page for each critter: its Critterbook number, a line about it, how to coax it and its special. A page opens the first time you're within 10 blocks of that critter and can see it, or when you get one. `/mobsquad journal` or the book in the Bunkhouse menu opens it. Critterbook numbers follow the order each mob first appeared in Minecraft Java Edition, so the creeper is No. 1 and the allay No. 75. Every mob in the game has a number already, and the numbers never change.
- **The sidekick.** A critter that has spent 10 hours out with you has a 1 in 10 chance each day of becoming your sidekick. It goes everywhere with you: it comes out when you join, after a world change and after a rest, and the Bunkhouse menu, its bell and the dinnerbell leave it be. It doesn't count toward your posse. One per player.
- **Vittles.** Right-click them to perk up a tuckered-out critter on the spot. Craft two from bread, a carrot and sweet berries.
- **Bunkhouses.** An admin marks a vault block as a Bunkhouse. Anyone who right-clicks it sees only their own critters. Click one to send it out or call it back. Critters never exist as items, so they can't be dropped, traded or duplicated.
- **Following.** A critter out with you walks after you and steps beside you if it's left more than 24 blocks behind.
Expand Down Expand Up @@ -48,6 +49,7 @@ Settings are in `plugins/MobSquad/config.yml`: worlds where MobSquad is off, the
| `/mobsquad vittles <player> [amount]` | admins | Gives vittles. |
| `/mobsquad xp <player> <amount>` | admins | Sets a player's Wranglin' experience. |
| `/mobsquad level <player> <critter> <level>` | admins | Sets every critter of that kind a player has to a level. |
| `/mobsquad sidekick <player> <critter\|none>` | admins | Makes a player's critter of that kind their sidekick, or clears it. |
| `/mobsquad reload` | admins | Rereads config.yml. |

`/ms` works too. Permissions: `mobsquad.use` (everyone) and `mobsquad.admin` (ops).
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = "com.extantape"
version = "0.4.0"
version = "0.5.0"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
Expand Down
5 changes: 5 additions & 0 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ Dated decisions for this repo, newest last.
- 2026-11-15: Critterbook numbers come from the first Java Edition entry in each mob's History section on the Minecraft Wiki, including experimental snapshots (the camel, sniffer, breeze, bogged and creaking first appeared behind experiments). A texture added before the mob doesn't count (piglin, silverfish). Mobs from the same version are ordered by first snapshot, then alphabetically by entity id. The 88 numbered are the mobs the wiki lists as current in Java Edition, without unused, removed, joke, Education or upcoming ones. The list is `src/main/resources/critterbook.txt`; numbers never change, and new mobs get the next numbers.
- 2026-11-15: a page opens when you're within 10 blocks of a living launch critter (anyone's, or wild) and have a clear line of sight, checked every 2 seconds, or when a critter is added to your Bunkhouse. Owning a critter always opens its page.
- 2026-11-15, written by the lead, for the owner's say: the eight page lines other than the creeper's, which is the owner's own (brief, "Voice").
- 2026-11-15, owner (ops D204), in the chief's chat: "Keep all eight" for the page lines, so they stand as written; and "Sidekick + later specials" as the next release.
- 2026-11-15: the sidekick's "long time" is 10 hours out together and its "small daily chance" is 1 in 10, rolled once per calendar day (server time) per player, only while an eligible critter is out, so a day without one doesn't use the roll up. The longest-serving eligible critter out is the one rolled for.
- 2026-11-15: until the Waystation hook exists, a sidekick never goes into the Bunkhouse on a player's say. It still leaves the world like any critter when its owner leaves, the server stops, or it's tuckered out, and comes back on its own when it can. A disabled world or a locked tier keeps it home.
- 2026-11-15: the brief's "later" parts of four specials unlock at level 25, the first milestone, and grow at the next ones: speedy eggs (first one 30 seconds after going out, then every 5 minutes, a minute sooner per later milestone; Speed II, III from level 75), the glowing sting (10 seconds, 5 more per later milestone), the pounce (a leap of up to 6 blocks at a mob not targeting the fox, double damage on the first hit, every 8 seconds, a second sooner per later milestone) and shared arrows (two every 2 minutes while carrying a bow or crossbow, one more and 20 seconds sooner per later milestone).
- 2026-11-15: speedy eggs can be picked up only by the chicken's owner and are used, never thrown, so they can't hatch chickens.
8 changes: 8 additions & 0 deletions docs/test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Kept by this repo's owning session, per `~/Code/CLAUDE.md`, "Test self-audits". Newest first.

## 2026-11-15: 0.5.0

- Promises added: README "The sidekick" and the level 25 additions to four specials, CHANGELOG 0.5.0, the sidekick and later-specials decisions.
- Covered by unit tests (ModelTest): 10 hours needed; a day with nobody eligible doesn't use the roll; the roll is small and once a day; one sidekick per player, only from critters out; sidekick, roll day and minutes round-trip; a sidekick not in the list is dropped; minutes out add up with their experience.
- Covered by bots (164 checks on 26.1.2 and 26.2, 75 on 26.3): an admin sets and clears a sidekick; it comes out on its own and is saved; it doesn't count toward the posse; the menu, its bell and the dinnerbell leave it out (the menu parts on 26.1.2 and 26.2); it goes when its owner leaves and comes back when they return; tuckered out, it rests and comes back once rested; cleared, the dinnerbell calls it home. From level 25: the bee's sting makes a husk glow; the fox's first hit is double; the chicken lays a speedy egg at your feet, and using it gives speed without throwing it; the skeleton shares two arrows when you carry a bow.
- Gaps skipped: the real daily roll (needs 10 hours out; the logic is unit tested and the server only feeds it the day and the critters out); milestone growth of the four additions (plain numbers from the stage, same path as covered); a sidekick following through a world change (the same keep-beside-you loop as rejoining, which is covered).
- Gaps for later: travelling with a sidekick through a gate, when the Waystation hook lands.

## 2026-11-15: 0.4.0

- Promises added: README "La Ménagerie", the journal command, CHANGELOG 0.4.0, the Critterbook decisions.
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/com/extantape/mobsquad/MobSquadPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ public void onLoad(EntitiesLoadEvent e) {
for (Species s : Species.values()) if (s.id().startsWith(b.getRemainingLowerCase())) b.suggest(s.id());
return b.buildFuture();
}).then(Commands.argument("level", IntegerArgumentType.integer(1, Growth.MAX)).executes(this::level)))))
.then(Commands.literal("sidekick").requires(src -> src.getSender().hasPermission("mobsquad.admin"))
.then(Commands.argument("player", ArgumentTypes.player())
.then(Commands.argument("critter", StringArgumentType.word()).suggests((c, b) -> {
b.suggest("none");
for (Species s : Species.values()) if (s.id().startsWith(b.getRemainingLowerCase())) b.suggest(s.id());
return b.buildFuture();
}).executes(this::sidekick))))
.then(Commands.literal("reload").requires(src -> src.getSender().hasPermission("mobsquad.admin")).executes(this::reload))
.build(),
"Your critters, the dinnerbell, and admin tools for Bunkhouses.", List.of("ms")));
Expand Down Expand Up @@ -283,6 +290,31 @@ private int level(CommandContext<CommandSourceStack> c) throws CommandSyntaxExce
return n == 0 ? 0 : Command.SINGLE_SUCCESS;
}

/** Makes a player's first critter of a kind their sidekick, or clears it with "none". */
private int sidekick(CommandContext<CommandSourceStack> c) throws CommandSyntaxException {
Player p = c.getArgument("player", PlayerSelectorArgumentResolver.class).resolve(c.getSource()).getFirst();
Wrangler w = squads.get(p);
if (w == null) {
say(c, p.getName() + "'s Bunkhouse list can't be read right now; see the server log.", NamedTextColor.RED);
return 0;
}
String kind = c.getArgument("critter", String.class);
if (kind.equals("none")) {
squads.setSidekick(p, null);
say(c, "[MobSquad] " + p.getName() + " has no sidekick now.", NamedTextColor.GREEN);
return Command.SINGLE_SUCCESS;
}
Species s = Species.byId(kind);
Critter pick = s == null ? null : w.critters.stream().filter(cr -> cr.species() == s).findFirst().orElse(null);
if (pick == null) {
say(c, p.getName() + " has no " + kind.replace('_', ' ') + ".", NamedTextColor.YELLOW);
return 0;
}
squads.setSidekick(p, pick);
say(c, "[MobSquad] " + pick.name() + " is " + p.getName() + "'s sidekick now.", NamedTextColor.GREEN);
return Command.SINGLE_SUCCESS;
}

private int reload(CommandContext<CommandSourceStack> c) {
reloadConfig();
squads.settings(Settings.read(getConfig(), getLogger()));
Expand Down
55 changes: 55 additions & 0 deletions src/main/java/com/extantape/mobsquad/Squads.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public Squads(Store store, Logger log, Settings settings) {

public void posse(Posse posse) {
this.posse = posse;
posse.sidekicks(id -> online.values().stream().anyMatch(w -> id.equals(w.sidekick)));
}

public void settings(Settings settings) {
Expand Down Expand Up @@ -115,12 +116,66 @@ public void critterXp(Posse.Out o, long xp) {
posse.update(n);
if (n.level() == c.level()) return;
save(w);
leveled(p, c, n);
}

private void leveled(Player p, Critter c, Critter n) {
p.sendMessage(Component.text(n.name() + " is now level " + n.level() + ".", NamedTextColor.GOLD));
if (com.extantape.mobsquad.model.Growth.stage(n.level()) > com.extantape.mobsquad.model.Growth.stage(c.level()))
p.sendMessage(Component.text("Its special grows stronger: " + n.species().special, NamedTextColor.LIGHT_PURPLE));
p.playSound(p.getLocation(), org.bukkit.Sound.ENTITY_PLAYER_LEVELUP, 0.6f, 1.4f);
}

public boolean isSidekick(UUID owner, UUID critter) {
Wrangler w = online.get(owner);
return w != null && critter.equals(w.sidekick);
}

/** A minute out: time together and walking experience, then today's sidekick roll. */
public void minuteOut(Player p, java.util.List<Posse.Out> out) {
Wrangler w = get(p);
if (w == null || out.isEmpty()) return;
java.util.List<UUID> ids = new java.util.ArrayList<>();
for (Posse.Out o : out) {
Critter c = w.find(o.critter().id());
if (c == null) continue;
ids.add(c.id());
Critter n = c.minuteOut(com.extantape.mobsquad.model.Growth.WALK_XP);
w.replace(n);
posse.update(n);
if (n.level() > c.level()) leveled(p, c, n);
}
long day = java.time.LocalDate.now().toEpochDay();
Critter chosen = com.extantape.mobsquad.model.Sidekicks.roll(w, ids, day, java.util.concurrent.ThreadLocalRandom.current()::nextDouble);
if (chosen != null) {
p.sendMessage(Component.text(chosen.name() + " has decided you're its favorite person. It's your sidekick now: it goes everywhere with you and doesn't count toward your posse.", NamedTextColor.GOLD));
p.playSound(p.getLocation(), org.bukkit.Sound.UI_TOAST_CHALLENGE_COMPLETE, 0.7f, 1.2f);
}
save(w);
}

/** Makes someone a player's sidekick, or nobody (admins). */
public void setSidekick(Player p, Critter c) {
Wrangler w = get(p);
if (w == null) return;
w.sidekick = c == null ? null : c.id();
save(w);
}

/** Puts each online player's sidekick beside them whenever it can be: after joining, a world change, a rest. */
public void keepSidekicks() {
long now = System.currentTimeMillis();
for (Player p : Bukkit.getOnlinePlayers()) {
Wrangler w = online.get(p.getUniqueId());
if (w == null || w.sidekick == null || posse.isOut(w.sidekick)) continue;
Critter c = w.find(w.sidekick);
if (c == null || c.resting(now) || p.isDead() || p.getGameMode() == org.bukkit.GameMode.SPECTATOR) continue;
if (!settings.enabledIn(p.getWorld().getName()) || !p.hasPermission("mobsquad.use") || !Levels.unlocked(c.species().tier, wranglinLevel(p))) continue;
posse.send(p, c);
p.sendActionBar(Component.text(c.name() + " is at your side.", NamedTextColor.GOLD));
}
}

/** Out of health: back to the Bunkhouse to rest a few real minutes. */
public void tucker(Posse.Out o) {
posse.back(o.critter().id());
Expand Down
Loading
Loading