Your cart is empty
Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shoppingAdd the Phoenix Crates API to your project and build add-ons and custom animations.
The API is only available for the premium version of the plugin.
Build your own extensions for Phoenix Crates with our public API. Events and Examples have their own pages.
<repositories>
<repository>
<id>phoenixplugins</id>
<url>https://repo.phoenixplugins.com/</url>
</repository>
</repositories>
<dependency>
<groupId>com.phoenixplugins.phoenixcrates</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Our public API covers the recommended integration points for addons.
If you need deeper access to internal classes and systems, we recommend using a direct systemPath dependency to your local Phoenix Crates plugin JAR.
<dependency>
<groupId>com.phoenixplugins.phoenixcrates</groupId>
<artifactId>internal</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/PhoenixCrates-1.0.0-SNAPSHOT.jar</systemPath>
</dependency>
Place the plugin JAR in your project's libs folder before building.
Custom Addons are extensions that allow you to extend, modify, or enhance Phoenix Crates behavior with your own Java code.
Create an addon.yml file in your project's resources folder.
name: AddonName
main: your.path.AddonExample
author: [YourName]
version: 1.0.0
description: Small description (optional)
website: https://your-website.com (optional)
Required fields:
name: Display name of your addon.main: Fully qualified path to your addon main class.author: One or more addon authors.version: Addon version.The main value in addon.yml must point to your class that extends Addon.
package your.path;
import com.phoenixplugins.phoenixcrates.api.sdk.plugin.addons.Addon;
public class AddonExample extends Addon {
@Override
public void onLoad() {
// Called when the addon is loaded.
}
@Override
public void onEnable() {
// Register listeners, commands, tasks, etc.
}
@Override
public void onDisable() {
// Cleanup logic.
}
@Override
public String getRequiredPluginVersion() {
return "5.0.0";
}
}
plugins/PhoenixCrates/addons.Create your own opening phase animations and register them at runtime through the API.
Extend OpeningPhaseAnimation and implement the lifecycle methods:
public class YourPhaseAnimation extends OpeningPhaseAnimation<EmptyOpeningPhaseData> {
public YourPhaseAnimation(OpeningCrateAnimation animation, OpeningPhaseType type,
EmptyOpeningPhaseData data) {
super(animation, type, data);
}
@Override
public void load() {
}
@Override
public void tick() {
}
@Override
public void unload() {
}
}
Register your phase during addon startup and unregister it on shutdown:
public void onEnable() {
registerPhase(
new OpeningPhaseType(PhaseType.FIRST, "YOUR_PHASE_IDENTIFIER",
"Your Display Name",
XMaterial.STONE, ServerVersion.v1_16_R1,
new XMaterial[] {}, EmptyOpeningPhaseData.class,
(animation, type, data) -> new YourPhaseAnimation(animation,
type, (EmptyOpeningPhaseData) data),
() -> new EmptyOpeningPhaseData()));
}
public void onDisable() {
for (final OpeningPhaseType type : this.registeredPhases) {
OpeningPhaseType.unregisterPhase(type);
}
}
private void registerPhase(OpeningPhaseType phase) {
// Registering first phase animations
OpeningPhaseType.registerPhase(phase);
// Caching to unload later on
this.registeredPhases.add(phase);
}
tick() when possible.onDisable().A plugin can register its own model engine, and crates can then use it like Model Engine or Better Model. The engine is shown in the crate editor, see Crate Block Engine. These classes are marked experimental.
Implement CrateModelEngine from com.phoenixplugins.phoenixcrates.api.crate.engine.model:
| Method | Purpose |
|---|---|
getName() |
The engine name, [a-z0-9_]{1,32} after lowercasing. |
isReady() |
Whether the engine can spawn models yet. |
whenReady(Runnable) |
Runs the task once the engine is ready. |
getModelIds() |
Every model the editor can offer. |
getAnimationIds(String modelId) |
The animations of a model. |
hasModel(String modelId) |
Whether a model exists. |
spawn(CrateModelSpawn) |
Spawns a model and returns a CrateModel, or null if it fails. |
CrateModelSpawn carries the location, model id, scale, view distance, an optional viewer when the model is shown to one player only, and an optional CrateModelClickHandler called with the player and whether it was a left click.
The returned CrateModel implements isValid(), hasAnimation(String), playLoop(String), playOnce(String, Runnable), stopAnimation(String), stopAllAnimations(), show(Player), hide(Player), getHeight() and remove().
Register it from your plugin when it enables:
CrateModelEngine.register(this, new YourModelEngine());
CrateModelEngine.unregister(engine) removes it again.
Your guide to the docs
Ask me anything about Phoenix Crates. I know these docs inside out, check the latest versions and changelogs, and can read your server logs.
Try asking
Your cart is empty
Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping