Add mob-data and mythic-mob custom block types#489
Merged
tastybento merged 5 commits intodevelopfrom Apr 8, 2026
Merged
Conversation
Adds two new phase YAML entry types so admins can summon mobs with richer customization than the existing `mob` entry: - `mob-data`: summons an entity via vanilla `/summon` NBT/component syntax, e.g. glowing breezes with a scale attribute. After summon, MakeSpace runs one tick later so oversized hitboxes clear the surrounding blocks automatically. Closes #488. - `mythic-mob`: spawns a MythicMob via BentoBox's MythicMobsHook with no direct MythicMobs dependency. Uses the new Consumer<Entity> overload on the hook so MakeSpace can run after the hook's 40-tick spawn delay. Falls back to the 2-arg signature via reflection for compatibility with BentoBox 3.13.0 until a newer release is cut. Closes #303. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The mob-data custom block glued NBT to the entity id, producing
`summon breeze{...} x y z`, which vanilla's command parser rejects with
"Unhandled exception". Split the data string at the first `{` or `[` so
the command becomes `summon <entity> <x> <y> <z> [nbt]`, matching the
vanilla grammar. Extracted into a package-private buildSummonCommand
helper with unit tests locking in the ordering for `{...}`, `[...]`,
and bare-entity inputs.
Also add an optional sibling `custom-blocks:` list in OneBlocksManager
so admins can keep their existing map-form `blocks:` section untouched
while registering custom entries like mob-data or mythic-mob — removes
the need to convert every vanilla block to list form just to add one
custom spawn. Both sections feed the same weighted pool.
Update the README examples and MobDataCustomBlock javadoc to use 1.21+
attribute syntax (`minecraft:scale`, not `minecraft:generic.scale`),
add a note about the 1.21 attribute-prefix rename, and enrich the
error log with a version-compat breadcrumb.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expose the existing BlockDataCustomBlock under a second key `block` so phase-file authors placing NBT-heavy blocks (preconfigured spawners, etc.) aren't forced to use the misleading `block-data` name. Both types route to the same handler; `block-data` stays the recommended key for simple block states while `block` signals intent when the data string contains NBT or a setblock mode flag. No behavioural change — BlockDataCustomBlock.execute already falls through to `/setblock <x> <y> <z> <data>` when Bukkit.createBlockData can't parse the string, which is exactly what NBT payloads need. Documented both forms in the README with a working spawner+breeze example (single-quoted to avoid YAML delimiter clashes) and added two routing tests in BlockCustomBlockTest to lock in the alias. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a commented-out `custom-blocks:` sibling section to the Plains phase showing all three custom entry types (block, mob-data, mythic-mob) with working, single-quoted data strings. Using the first-phase file as the on-disk reference template matches how other optional sections (start-commands, requirements, etc.) are documented in this file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Placing a spawner via /setblock with only SpawnData leaves the timing fields at their uninitialised defaults — specifically Delay:-1, which means "inactive, never tick". The example spawner appeared correctly but never spawned anything. Update the README and 0_plains.yml block example to set Delay, MinSpawnDelay, MaxSpawnDelay, SpawnCount, SpawnRange, MaxNearbyEntities, and RequiredPlayerRange explicitly so the spawner actually ticks. Add a README "Spawner gotcha" callout explaining why the timing fields are necessary, and an inline comment in the phase YAML pointing at the same trap. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
mob-dataphase entry type that summons an entity via the vanilla/summonNBT/component syntax (e.g. glowing breeze with aminecraft:generic.scaleattribute). Closes mob-data #488.mythic-mobphase entry type that spawns a MythicMob via BentoBox'sMythicMobsHook, with no direct MythicMobs compile dependency. Closes MythicMobs Spawn Possibility #303.MakeSpaceruns after spawn so scaled/oversized hitboxes automatically clear surrounding blocks —mob-dataschedules it one tick later (to let NBT-driven attributes likescaleapply) andmythic-mobpasses it as theConsumer<Entity>callback on the newMythicMobsHook.spawnMythicMob(record, loc, Consumer)overload.MythicMobCustomBlockuses reflection to detect the 3-arg hook overload, so the addon still compiles and runs against BentoBox 3.13.0 and transparently lights up theMakeSpacecallback once users upgrade to a BentoBox build containing the overload.YAML example
Test plan
mvn test— 403 tests pass (10 new unit tests inMobDataCustomBlockTestandMythicMobCustomBlockTestcovering parsing, defaults, invalid underlying-block handling, string-to-numeric coercion, and creator routing).mvn package— builds cleanly.mythic-mobentry logs a warning and gameplay continues without errors.🤖 Generated with Claude Code