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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.6.0

Wranglin' in AuraSkills.

- **With AuraSkills installed**, Wranglin' is one of its skills, with a lead as its icon and MobSquad's level. MobSquad still keeps the level in the player's file and copies it to AuraSkills when it changes, when the player joins and when an admin uses `/mobsquad xp`. A level set with AuraSkills' commands is put back at the next change or join. AuraSkills' XP multipliers and rewards don't apply.
- The skill's AuraSkills settings are written to `plugins/MobSquad/auraskills` the first time. MobSquad declares `auraskills.skill.wranglin` (default true), which AuraSkills checks for each skill.
- Without AuraSkills nothing changes. Built against AuraSkills 2.4.0.
- **World groups.** Tested with Multiverse-Inventories 5.3.6: crossing to another inventory group sends critters home, the sidekick comes along as one copy, and nothing turns into an item.
- **Fixed:** a block the enderman fetched went into your inventory in whatever world you were in a second later, so it could cross world groups, and it was lost if the enderman went home in that second. It now goes to you only in the world it came from, and otherwise drops where the block was.

## 0.5.0

The sidekick and the later parts of four specials.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.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.
**Status:** 0.6.0. Wranglin' in AuraSkills, and world groups tested with Multiverse-Inventories. Passed with bots on throwaway Paper 26.1.2 and 26.2 servers (164 checks each, plus 30 with AuraSkills and 22 with Multiverse on 26.2). 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

Expand All @@ -13,7 +13,7 @@ Coax mobs into critters for Paper: they follow you, fight only hostile mobs, and
- 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. 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.
- 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, and the hit it lands with the pounce does double damage.
- 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.
Expand All @@ -25,6 +25,8 @@ Coax mobs into critters for Paper: they follow you, fight only hostile mobs, and
- **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.
- **Wranglin'.** Coaxing earns Wranglin' experience. One critter can be out at once, two from level 10 and three from level 25. Mob tiers unlock at levels 1, 10, 25 and 40.
- **AuraSkills.** If AuraSkills is installed, Wranglin' shows up as one of its skills, with MobSquad's level. MobSquad keeps the level in the player's file and copies it to AuraSkills when it changes and when the player joins, so a level set with AuraSkills' own commands is put back. AuraSkills' XP multipliers and rewards don't apply to Wranglin'. The skill's AuraSkills settings are in `plugins/MobSquad/auraskills`. Without AuraSkills, nothing changes.
- **World groups.** With Multiverse-Inventories, critters cross to another inventory group only through the Bunkhouse: crossing sends the ones out with you home, and you can send them out again from a Bunkhouse there. The sidekick comes along, one copy. A block the enderman fetches only goes into your inventory in the world it came from.
- **Safety.** A critter never targets or hurts a player, and players can't hurt it. It never changes a block on its own, explodes, burns in the sun or wanders off by teleporting. The two specials that touch blocks go through the server's own checks: the bee's crops grow through the same event as natural growth, and the enderman takes a block only where a block-break check as you passes. Out of health, it's tuckered out: it drops nothing and rests in the Bunkhouse for 5 real minutes.
- **The dinnerbell.** Ring it and every critter out with you heads home.
- **Plain files.** One text file per player in `plugins/MobSquad/players`. A critter out in the world is never saved with the world, so after a restart, a crash or the player leaving, it's back in the Bunkhouse exactly once.
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.5.0"
version = "0.6.0"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
Expand Down
1 change: 1 addition & 0 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Dated decisions for this repo, newest last.
- 2026-11-15: 0.1.0 builds the core loop from plan.md step 1. Wranglin' is MobSquad's own level in 0.1.0; the AuraSkills hook follows once it can be tested on a throwaway server with AuraSkills installed.
- 2026-11-15: critters out in the world are non-persistent mobs; only the player's Bunkhouse file is saved. A critter left in a chunk after a crash is removed when the chunk loads.
- 2026-11-15: a tier gates sending a critter out as well as coaxing it, so a critter an admin gives early waits for the level.
- 2026-11-15, 0.6.0: MobSquad keeps the Wranglin' level and copies it to AuraSkills, rather than handing AuraSkills the experience. On a test server, AuraSkills 2.4.0 dropped experience given to a skill from another plugin: `addSkillXp` gave none at all, and `addSkillXpRaw` lost it when the skill levelled up. Copying the level also keeps posse sizes and tiers on one curve. This replaces the earlier AuraSkills decision above.
- 2026-11-15: running on a seed trail means sprinting, riding, gliding, flying or crossing more than 1.35 blocks in a quarter second, about 1.25 times walking pace. A longer jump counts as a teleport, which loses the trail instead.
- 2026-11-15: bot tests use port 25631.
- 2026-11-15: public at the first release under the owner's standing yes of 2026-11-07, relayed by Simon: MIT, Copyright (c) 2026 EXTANT APE, after the first-public-push audit (no secrets, addresses, player data or build output; no private-term hits in any file, commit or message).
Expand Down
9 changes: 9 additions & 0 deletions docs/test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

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

## 2026-11-15: 0.6.0

- Promises added: README "AuraSkills" and "World groups", CHANGELOG 0.6.0, the 0.6.0 AuraSkills decision.
- Covered by bots with AuraSkills 2.4.0 (30 checks on 26.1.2 and 26.2, 25 on 26.3): Wranglin' registers as a skill; a level-up from coaxing shows in AuraSkills; a MobSquad level shows in AuraSkills when a player joins; MobSquad's own level counts whatever AuraSkills says; `/mobsquad xp` sets both; MobSquad keeps its own count.
- Covered by bots with Multiverse-Core 5.8.2 and Multiverse-Inventories 5.3.6 (22 checks on 26.2): inventories are really kept apart; crossing sends a critter home, in neither world; the sidekick comes along as one copy and comes back; nothing turns into an item; every critter stays in the file once; an enderman block fetched as you cross groups stays behind and drops where it was taken.
- Full suite after the change: 164 on 26.1.2 and 26.2, 75 on 26.3. The fox pounce check now looks for one double hit among the first three, since a plain hit can land first; the README says so.
- Gaps skipped: AuraSkills' own menus and messages (AuraSkills draws them from the registered skill); the world-group checks on 26.1.2 and 26.3 (the same MobSquad code as 26.2; on 26.3 the bots can't open the Bunkhouse).
- Gaps for later: crossing groups through a Waystation gate, with the Waystation hook.

## 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.
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/extantape/mobsquad/MobSquadPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ public final class MobSquadPlugin extends JavaPlugin {
public void onEnable() {
saveDefaultConfig();
squads = new Squads(new Store(getDataFolder().toPath().resolve("players")), getLogger(), Settings.read(getConfig(), getLogger()));
if (getServer().getPluginManager().getPlugin("AuraSkills") != null) {
try {
squads.skill(com.extantape.mobsquad.hook.AuraSkillsWranglin.register(this));
getLogger().info("Wranglin' is an AuraSkills skill.");
} catch (RuntimeException | LinkageError e) {
getLogger().log(java.util.logging.Level.WARNING, "Couldn't register Wranglin' with AuraSkills, so MobSquad keeps its own level.", e);
}
}
Posse posse = new Posse(this, o -> {});
squads.posse(posse);
bunkhouses = new Bunkhouses(this);
Expand All @@ -76,6 +84,8 @@ public void onEnable() {
@EventHandler
public void onJoin(org.bukkit.event.player.PlayerJoinEvent e) {
e.getPlayer().discoverRecipe(vittles.key());
if (squads.skill() != null) // a few seconds on, once AuraSkills has loaded the player
getServer().getScheduler().runTaskLater(MobSquadPlugin.this, () -> { if (e.getPlayer().isOnline()) squads.showWranglin(e.getPlayer()); }, 60L);
}

/** A critter left behind by a crash is never saved, but if one turns up, it goes. */
Expand Down Expand Up @@ -258,6 +268,7 @@ private int xp(CommandContext<CommandSourceStack> c) throws CommandSyntaxExcepti
}
w.wranglinXp = c.getArgument("amount", Integer.class);
squads.save(w);
squads.showWranglin(p);
say(c, "[MobSquad] " + p.getName() + " has " + w.wranglinXp + " Wranglin' experience, level " + Levels.level(w.wranglinXp) + ".", NamedTextColor.GREEN);
return Command.SINGLE_SUCCESS;
}
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/extantape/mobsquad/Squads.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public final class Squads {
private final Map<UUID, Wrangler> online = new HashMap<>();
private Posse posse;
private Settings settings;
private com.extantape.mobsquad.hook.WranglinSkill skill;
private java.util.function.BiConsumer<Player, com.extantape.mobsquad.model.Species> pageOpener;

public Squads(Store store, Logger log, Settings settings) {
Expand Down Expand Up @@ -75,18 +76,33 @@ public void leave(Player p) {
save(online.remove(p.getUniqueId()));
}

/** A skill plugin (AuraSkills) that shows Wranglin', or null. */
public void skill(com.extantape.mobsquad.hook.WranglinSkill skill) {
this.skill = skill;
}

public com.extantape.mobsquad.hook.WranglinSkill skill() {
return skill;
}

public int wranglinLevel(Player p) {
Wrangler w = get(p);
return w == null ? 1 : Levels.level(w.wranglinXp);
}

/** Copies the player's Wranglin' level to the skill plugin, if there is one. */
public void showWranglin(Player p) {
if (skill != null) skill.show(p, wranglinLevel(p));
}

public void addWranglin(Player p, long xp) {
Wrangler w = get(p);
if (w == null) return;
int before = Levels.level(w.wranglinXp);
w.wranglinXp += xp;
int after = Levels.level(w.wranglinXp);
save(w);
if (skill != null && after != before) skill.show(p, after);
if (after > before) p.sendMessage(Component.text("Your Wranglin' is now level " + after + ".", NamedTextColor.GOLD));
}

Expand Down
50 changes: 50 additions & 0 deletions src/main/java/com/extantape/mobsquad/hook/AuraSkillsWranglin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.extantape.mobsquad.hook;

import dev.aurelium.auraskills.api.AuraSkillsApi;
import dev.aurelium.auraskills.api.item.ItemContext;
import dev.aurelium.auraskills.api.registry.NamespacedId;
import dev.aurelium.auraskills.api.registry.NamespacedRegistry;
import dev.aurelium.auraskills.api.skill.CustomSkill;
import dev.aurelium.auraskills.api.user.SkillsUser;
import java.io.File;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

/**
* Wranglin' as an AuraSkills skill (brief, "How the plugins fit"). Only loaded when AuraSkills is installed, so the
* rest of MobSquad never touches its classes. The skill's settings are in {@code plugins/MobSquad/auraskills}.
* <p>MobSquad sets the level rather than adding experience: AuraSkills 2.4.0 loses experience that other plugins add to
* their own skills when it levels them up, and its level curve differs from MobSquad's.
*/
public final class AuraSkillsWranglin implements WranglinSkill {
private final AuraSkillsApi api;
private final CustomSkill skill;

private AuraSkillsWranglin(AuraSkillsApi api, CustomSkill skill) {
this.api = api;
this.skill = skill;
}

public static AuraSkillsWranglin register(JavaPlugin plugin) {
File dir = new File(plugin.getDataFolder(), "auraskills");
for (String f : new String[] {"auraskills/skills.yml", "auraskills/sources/wranglin.yml"})
if (!new File(plugin.getDataFolder(), f).exists()) plugin.saveResource(f, false);
AuraSkillsApi api = AuraSkillsApi.get();
NamespacedRegistry registry = api.useRegistry("mobsquad", dir);
CustomSkill skill = CustomSkill.builder(NamespacedId.of("mobsquad", "wranglin"))
.displayName("Wranglin'")
.description("Coax mobs into critters. Higher levels let more critters out at once and open new tiers of mobs.")
.item(ItemContext.builder().material("lead").pos("4,5").build())
.build();
registry.registerSkill(skill);
return new AuraSkillsWranglin(api, skill);
}

@Override
public void show(Player p, int level) {
SkillsUser u = api.getUser(p.getUniqueId());
if (u == null || !u.isLoaded() || u.getSkillLevel(skill) == level) return;
u.setSkillLevel(skill, level);
u.setSkillXp(skill, 0);
}
}
12 changes: 12 additions & 0 deletions src/main/java/com/extantape/mobsquad/hook/WranglinSkill.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.extantape.mobsquad.hook;

import org.bukkit.entity.Player;

/**
* A skill plugin that shows Wranglin'. MobSquad keeps the level itself, in the player's file, and copies it here, so the
* two never disagree and nothing is lost if that plugin goes away.
*/
public interface WranglinSkill {
/** Shows this level for the player. Does nothing when their data isn't loaded yet. */
void show(Player p, int level);
}
10 changes: 7 additions & 3 deletions src/main/java/com/extantape/mobsquad/world/Specials.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,16 @@ boolean fetchBlock(Player p) {
posse().moveCritter(e, b.getLocation().add(0.5, 1, 0.5));
b.setType(Material.AIR, true);
b.getWorld().spawnParticle(Particle.PORTAL, b.getLocation().add(0.5, 0.5, 0.5), 30, 0.3, 0.5, 0.3);
Location spot = b.getLocation().add(0.5, 0.5, 0.5);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
// the block is the owner's even if the enderman went home meanwhile, but only in the world it came from, so
// nothing crosses world groups (Multiverse-Inventories); otherwise it drops where the block was
boolean here = p.isOnline() && p.getWorld().equals(spot.getWorld());
if (here) give(p, new ItemStack(item));
else spot.getWorld().dropItem(spot, new ItemStack(item));
if (!e.isValid()) return;
e.setCarriedBlock(null);
Location home = p.isOnline() && p.getWorld().equals(e.getWorld()) ? p.getLocation() : back;
posse().moveCritter(e, home);
if (p.isOnline()) give(p, new ItemStack(item));
posse().moveCritter(e, here && p.getWorld().equals(e.getWorld()) ? p.getLocation() : back);
}, 20L);
return true;
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/auraskills/skills.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Wranglin' in AuraSkills, read by AuraSkills when MobSquad registers the skill.
# MobSquad's posse sizes and tiers use these levels: 2 critters out from level 10, 3 from 25; tiers at 1, 10, 25 and 40.
skills:
mobsquad/wranglin:
abilities: []
options:
enabled: true
max_level: 100
check_cancelled: true
check_multiplier_permissions: true
2 changes: 2 additions & 0 deletions src/main/resources/auraskills/sources/wranglin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Wranglin' experience comes only from MobSquad (coaxing a critter), so there are no AuraSkills sources here.
sources: {}
10 changes: 10 additions & 0 deletions src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ main: com.extantape.mobsquad.MobSquadPlugin
api-version: '26.1'
description: "Coax mobs into critters that follow you, fight only hostile mobs and rest in a Bunkhouse. Gotta coax em all... Pokemob!"
website: https://github.com/ExtantApe/MobSquad
# Optional: with AuraSkills installed, Wranglin' is an AuraSkills skill.
dependencies:
server:
AuraSkills:
load: BEFORE
required: false
join-classpath: true
# Commands are registered with Brigadier in code, so there is no commands section.
permissions:
mobsquad.use:
Expand All @@ -12,3 +19,6 @@ permissions:
mobsquad.admin:
description: Mark Bunkhouses and use /mobsquad admin commands.
default: op
auraskills.skill.wranglin:
description: Earn Wranglin' in AuraSkills. AuraSkills checks this for each skill but doesn't declare it for skills other plugins add, so MobSquad does.
default: true
3 changes: 3 additions & 0 deletions test/fetch-jars.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ for (const [project, name, pick] of [
['griefprevention', 'GriefPrevention.jar', { version: '16.18.7' }], // the one release listed for 26.1.2 to 26.3
['coreprotect', 'CoreProtect.jar', { version: '24.1' }],
['prism', 'Prism.jar', { game: '26.3' }], // 4.5, the first 4.x listed for 26.3
['auraskills', 'AuraSkills.jar', { version: '2.4.0' }], // the version the hook is built against; lists 26.1.2 to 26.3
['multiverse-core', 'Multiverse-Core.jar', { version: '5.8.2' }], // world groups test
['multiverse-inventories', 'Multiverse-Inventories.jar', { version: '5.3.6' }],
]) {
const versions = await json(`https://api.modrinth.com/v2/project/${project}/version`)
const v = pick.version ? versions.find(x => x.version_number === pick.version)
Expand Down
Loading
Loading