Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loonium with data-driven structure loot #4639

Open
wants to merge 19 commits into
base: 1.20.x
Choose a base branch
from

Conversation

TheRealWormbo
Copy link
Collaborator

@TheRealWormbo TheRealWormbo commented May 10, 2024

Implementation for structure detection and structure-specific loot tables and mob spawning pools, customizable via data packs.

  • structure-specific loot tables are identified by the structure ID (e.g. for minecraft:pillager_outpost the custom Loonium loot table is located at data/botania/loot_tables/loonium/minecraft/pillager_outpost.json), with a default loot table corresponding to dungeon loot (located at data/botania/loot_tables/loonium/default.json)
    • default loot tables are created with Datagen
    • loot tables usually just reference original chest or entity loot tables related to each structure, so Loonium loot can be modified separately from the loot found in those structures
  • structure-specific Loonium configurations are identified the same way (e.g. for minecraft:pillager_outpost the custom configuration is located at data/minecraft/config/loonium/pillager_outpost.json) with a default configuration (located at data/botania/config/loonium/default.json) acting as fallback
    • default configurations are created via Datagen
    • configurations can reference a parent configuration and only override individual aspects of the referenced configuration
    • configurations consist of mana cost to spawn a mob, how many mobs of spawnable types are allowed around the flower, whether the Loonium must be placed in the overall bounding box or an individual piece of the structure, the weighted list of mobs to spawn, a list of potion effects to apply to spawned mobs, and a list of attribute modifiers to apply to the mobs
      • attribute and effect lists can be overridden for individual mobs
      • custom NBT data can be defined for individual mobs (used to make a Creeper spawn charged)
      • equipment loot tables can be specified for each spawnable mob (this will be a vanilla feature in later Minecraft versions, although the implementation here is slightly tweaked from what Trial Chambers use)
  • expanded wand HUD to indicate whether a Loonium generates structure-specific loot
  • added lexicon mention of the structure-specific behavior
  • fixed the mob location selection logic to prevent mobs from immediately starting to suffocate
  • added a new challenge advancement for killing every mob type in the structure configurations added with this change
  • mobs spawned by the Loonium are put onto a unique team so they don't just start attacking each other (because there are zoglins in some of the mob spawn pools; Heisei Dream may need a future upgrade to support overriding teams allegiances)

@TheRealWormbo
Copy link
Collaborator Author

Supersedes #4313, but is only loosely based on that PR.

Loonium figures out which structures(s) it was placed in and uses a corresponding list of loot tables with the id `botania:loonium/<structure_namespace>/<structure_path>`. If the flower is placed in overlapping pieces of multiple structures with configured loot tables, it randomly chooses one of the tables whenever it spawns a mob.
The Loonium drop capability is now attached to all mob entities, in preparation of customizable mob pools. Default equipment slot drops are turned off.

TODO: Define loot tables for relevant vanilla structures.
TODO: Define structure configuration data (JSON, likely separate registry) for the spawnable mob pool and whether the flower must be placed within a structure piece or anywhere within the structure's overall bounding box, maybe even the amount of mana per spawned mob.
TODO: Move default configuration to a default structure configuration entry.
(can't be detected reliably)
- tweak ancient table selection city weights
- fix reference to elder guardian drops loot table
- remove type specification on Loonium loot tables, as it caused validation warnings
(includes a generic reloadable config data manager, which currently only covers Loonium configurations)
(covers e.g. the skeleton from a spider jockey or the bonus chicken for some baby zombies)
(such as skeletons from a spider jockey or chickens from a zombie jockey, provided they are in the spawned mobs list)
- move inner config classes to own files
- add builders where appropriate
- simplify optional field definitions in codecs where possible, and remove constructors with Optional arguments
@TheRealWormbo TheRealWormbo marked this pull request as draft May 20, 2024 19:13
@TheRealWormbo TheRealWormbo force-pushed the 1.20-loonium-structures branch 2 times, most recently from c427f4d to 1842248 Compare May 22, 2024 20:34
Equipment tables are not vanilla yet, so they currently use the "selector" loot table type and are applied manually by the Loonium.
Nested loot table definitions also currently need to be loot table references, since embedded tables as pool entries are not supported by vanilla yet either.
@TheRealWormbo TheRealWormbo marked this pull request as ready for review May 26, 2024 10:43
- mobs are spawned on a unique team, which means even Loonium-spawned zoglins don't attack other Loonium-spawned mobs
- new challenge advancement "King" requires killing each of the currently 22 different mobs the Loonium spawns in different structures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant