A P I
MythicCrucible ships a small, stable integration API (MythicCrucibleAPI), a set of Bukkit events, and, because every Crucible item is also a MythicMobs item, full access to the MythicMobs API for item and skill work.
Repositories
The API is published to the same Lumine repository as MythicMobs.
Maven
<repository>
<id>nexus</id>
<name>Lumine Releases</name>
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
Gradle (Groovy)
repositories {
// ...
mavenCentral()
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
}
Gradle (Kotlin)
repositories {
// ...
mavenCentral()
maven(url = "https://mvn.lumine.io/repository/maven-public/")
}
Dependencies
The Crucible API artifact (furniture operations and events). Replace the version with the latest published one; the artifact ships a sources jar, so your IDE will show the API's documentation.
Maven
<dependency>
<groupId>io.lumine</groupId>
<artifactId>MythicCrucible-API</artifactId>
<version>5.13.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Gradle (Groovy)
dependencies {
// ...
compileOnly 'io.lumine:MythicCrucible-API:5.13.0-SNAPSHOT'
}
Gradle (Kotlin)
dependencies {
// ...
compileOnly("io.lumine:MythicCrucible-API:5.13.0-SNAPSHOT")
}
You will almost always also want the MythicMobs API (Mythic-Dist) for item and skill access, since Crucible builds on it. See the MythicMobs API page for its coordinates and current version. Documentation for the Mythic types used alongside this API (MythicItem, AbstractItemStack, and so on) lives in the Mythic JavaDocs.
plugin.yml
Add MythicCrucible (and MythicMobs) to your depend so your plugin loads after them:
depend: [MythicMobs, MythicCrucible]
Getting the API
import io.lumine.mythiccrucible.api.MythicCrucibleAPI;
import io.lumine.mythiccrucible.api.MythicCrucibleProvider;
MythicCrucibleAPI crucible = MythicCrucibleProvider.get();
MythicCrucibleProvider.get() throws IllegalStateException until Crucible has finished enabling, so only call it once Crucible is ready: after the MythicCrucibleLoadedEvent fires, or from your own onEnable() with MythicCrucible in your plugin.yml depend.
The whole API is expressed in stable terms (String item ids, Bukkit Block/Player, primitives and Optionals), so you never bind to Crucible's internal classes. Every method degrades gracefully (returns empty/false) when an id is unknown, a block holds no furniture, or the plugin is not ready.
Examples
Check for furniture at a block
MythicCrucibleAPI crucible = MythicCrucibleProvider.get();
Block block = ...;
if (crucible.isFurniture(block)) {
crucible.getFurnitureItemId(block).ifPresent(id -> {
// id is the Crucible item id of the furniture at this block
});
}
Place furniture
boolean placed = crucible.placeFurniture("MyChair", block, 90f);
For feedback on why placement failed, use the result variant:
import io.lumine.mythiccrucible.api.FurniturePlacementResult;
FurniturePlacementResult result = crucible.placeFurnitureResult("MyChair", block, 90f);
switch (result) {
case SUCCESS -> player.sendMessage("Placed!");
case OBSTRUCTED -> player.sendMessage("Not enough room.");
case NO_SUPPORTING_BLOCK -> player.sendMessage("Needs a solid surface to rest on.");
case UNSUPPORTED_PLACEMENT -> player.sendMessage("Can't place that here.");
case UNKNOWN_ITEM, NOT_FURNITURE -> player.sendMessage("That isn't a furniture item.");
default -> player.sendMessage("Could not place that.");
}
Clear terrain before placing large furniture
getFurnitureFootprint returns exactly the blocks placeFurniture checks (the base block plus rotated Barriers/Lights offsets), so you can clear them first, then place:
List<Block> footprint = crucible.getFurnitureFootprint("BigStatue", block, 0f);
for (Block b : footprint) {
b.setType(Material.AIR);
}
crucible.placeFurniture("BigStatue", block, 0f);
Remove furniture
// remove, running break skills + drop table, and dropping the stored inventory
crucible.removeFurniture(block, player, true, true);
Generate a Crucible item as an ItemStack
Crucible items are MythicMobs items, so generate them through the MythicMobs item API:
import io.lumine.mythic.bukkit.MythicBukkit;
import io.lumine.mythic.bukkit.BukkitAdapter;
MythicBukkit.inst().getItemManager().getItem("MyCrucibleItem").ifPresent(item -> {
ItemStack stack = BukkitAdapter.adapt(item.generateItemStack(1));
player.getInventory().addItem(stack);
});
Events
Bukkit events fired by MythicCrucible. A checkmark in the Cancellable column means the event implements Cancellable.
Furniture
| Event | Description | Cancellable |
|---|---|---|
| MythicFurniturePlaceEvent | Fired when a player places a furniture item. Exposes the player, block, block face, yaw and color. | yes |
| MythicFurnitureRemoveEvent | Fired when a furniture is removed or broken. Exposes the breaker and the furniture. | yes |
| MythicFurnitureRotateEvent | Fired when a player rotates a furniture. | yes |
| MythicFurnitureTrackEvent | Fired when a furniture entity starts being tracked (loaded into the world). | |
| MythicFurnitureUntrackEvent | Fired when a furniture entity stops being tracked (unloaded from the world). |
Lifecycle
| Event | Description | Cancellable |
|---|---|---|
| MythicCrucibleLoadedEvent | Fired after MythicCrucible finishes loading. Exposes the plugin instance. | |
| MythicCrucibleGeneratePackEvent | Fired when MythicCrucible finishes generating a resource pack. Exposes the generated zip file. |
Crafting
| Event | Description | Cancellable |
|---|---|---|
| MythicCraftItemEvent | Fired for a craft in Crucible's custom crafting system. Exposes the result and input inventories and the triggering InventoryClickEvent. |
yes |
Custom Mechanics, Conditions, Placeholders & Triggers
Crucible's own item mechanics, conditions, targeters, placeholders and triggers are built with the exact same annotation-based system MythicMobs uses (@MythicMechanic, @MythicCondition, @MythicTargeter, @MythicPlaceholder, and SkillTrigger). There is nothing Crucible-specific about registering them, so to add your own follow the MythicMobs API guide (its "Registering Custom Components" section). Custom triggers are dispatched through the same Mythic event bus.