Ritual thingy
A modification that allows mod, modpack, and datapack developers to create customizable summoning rituals through a data-driven system.
Main Features
Multiblock Structures
Support for multiblock structures is implemented through integration with Patchouli, while alternative systems are being developed. Add multiblock constructions through Patchouli JSON files or using the corresponding API. Blocks added to the ritual-thingy:altar tag are checked for multiblock structures when right-clicked.
Item Conditions
The mod supports checking conditions for items in the player's main hand. Additional conditions can be added through the API.
Entity Waves
Ability to configure multiple waves, each of which can contain several groups of mobs with customizable NBT data. For each wave, you can set a custom name, boss bar color, and two display modes: by entity count or by total health.
Item Actions
Various reward distribution methods are supported: adding to the player's inventory, dropping at the ritual location, or dropping on top of the ritual block. Additional actions can be implemented through the API.
Additional features include customizable delays for boss bars, custom start and completion messages, and special sound effects.
Configuration Format
Ritual files should be located at the path data/YOUR_NAMESPACE/rituals/RITUAL_NAME.json
Keys marked with are mandatory (but can be omitted if the parent tag is missing)
{
"soundEvent": "block.beacon.activate", // Sound played at the start
"maxUses": 1, // Maximum number of ritual uses per player. Set to 0 to disable
"altar": {
"patchouli": true, // Must be set to true
"id": "ritual-thingy:test_altar", // Patchouli altar identifier
"itemCondition": { // Do not include to disable item checking
"predicate": "ritual-thingy:mainhand", // Predicate identifier (default "ritual-thingy:mainhand")
"ingredient": { // Ingredient: uses the same format as recipes
"item": "minecraft:stick"
},
"decrement": 1 // Remove this many items from the stack when using the correct item
},
"dimensionCondition": {
"dimensions": [
"minecraft:overworld"
], // List of allowed dimensions
"allowed": true // True means the list contains allowed dimensions, false - forbidden
}
},
"stack": { // Item reward
"item": "minecraft:diamond_sword",
"count": 1
},
"startMessage": "Ritual starting", // Message at the start
"completeMessage": "Ritual ending", // Message at the end
"completeAction": "ritual-thingy:drop_offset", // Item action identifier (default "ritual-thingy:none")
"trial": { // Skip for instant ritual completion
"waveTickDelay": 80, // Delay between trial waves in ticks
"beginningCountdown": 80, // Countdown to trial in ticks
"delayBossBarColor": "blue", // Boss bar color for delay and countdown
"waves": [ // Entity waves
{
"bossBarText": "Pig", // Boss bar text for the wave
"bossBarColor": "blue", // Boss bar color for the wave
"isBoss": true, // Whether boss bar should display health instead of entity count
"spawnRange": 4, // Mob spawn range from clicked block
"startSound": "entity.wither.shoot", // Sound at wave start
"endSound": "entity.experience_orb.pickup", // Sound at wave end
"groups": [ // Individual entity groups
{// This group contains one pig with no additional data
"count": 1,
"entityType": "minecraft:pig"
}
]
},
{
"bossBarText": "Cows",
"bossBarColor": "blue",
"spawnRange": 4,
"startSound": "entity.wither.shoot",
"endSound": "entity.experience_orb.pickup", // Use the end sound of the last wave as the end sound of the ritual itself
"groups": [
{
"count": 8,
"entityType": "minecraft:cow",
"tag": "{}" // Additional entity data (name, armor, effects, variant...)
}
]
}
]
}
}
Dependencies
To use the API or other parts of the mod as a developer, add this to your build.gradle
repositories {
maven {
url = 'https://maven.riftrealms.de/releases'
}
repositories {
maven { url 'https://maven.blamejared.com' }
}
}
dependencies {
// Add the version to your gradle.properties or replace ${project.ritual_thingy_version} with the mod version
modApi "eu.ansquare.ritualthingy:ritual-thingy:${project.ritual_thingy_version}"
}
API
The Ritual API allows modders to add their own item actions, conditions, and events that prevent a ritual from starting. They are registered in the common initializer in the following formats:
Conditions
ItemConditionPredicate YOUR_CONDITION = RitualApi.registerItemCondition(new Identifier("YOUR_MOD_ID", "YOUR_CONDITION_ID"), (ingredient, player, pos) -> {
ItemStack stack = // Get the item stack
return new Pair<>(ingredient.test(stack), stack); // Test the stack with the ingredient and return it for possible decrementing
});
Default conditions:
ritual-thingy:mainhandchecks the item in the player's main hand
Actions
ItemConditionPredicate YOUR_ACTION = RitualApi.registerItemAction(new Identifier("YOUR_MOD_ID", "YOUR_ACTION_ID"), (stack, player, pos) -> {
// Execute the action
});
Default actions:
ritual-thingy:none- do nothingritual-thingy:give- give the item to the playerritual-thingy:drop- drop at the ritual block positionritual-thingy:drop_offset- drop one block above the ritual block (on top of it)
Ritual Prevention
PreventRitualCallback.EVENT.register((player, world, hand, hitResult) -> {
return false; // Return false if ritual is not allowed
});