🛠️Developer API

Welcome to the VortexStacker API. This API allows developers to hook into the stacking system, listen for stacking events, and programmatically manage stacked entities, spawners, and loot.

circle-info

You can browse our available API versions and artifacts directly in your browser at our repositioryarrow-up-right.

📦 Dependency Management

To use the API, you need to add our Maven repository and the API dependency to your project.

Maven

Add the following to your pom.xml:

<repository>
    <id>vortex-repo</id>
    <url>https://repo.vortexdevelopment.net/repository</url>
</repository>

<dependency>
    <groupId>net.vortexdevelopment</groupId>
    <artifactId>VortexStacker-API</artifactId>
    <version>latest</version> <!-- Or use a specific version -->
    <scope>provided</scope>
</dependency>

Gradle (Groovy)

Add the following to your build.gradle:


🚀 Getting Started

Accessing the API

The main entry point for the API is the VortexStackerApi class. Note that you should always check if the plugin is enabled before accessing it as well as each manager for modules can be null if they are disabled. All methods staticly accessible from the VortexStackerApi class for each module.

💠 API Modules

The API is split into several modules to keep things organized:

  • StackedEntityManager: Handle mob stacking logic, manually merge entities, and access stack data/amounts from living entities.

  • StackedSpawnerManager: Programmatically manage stacked spawners at specific locations and update spawner holograms.

  • StackedBlockManager: Interact with stacked blocks (like Iron/Emerald blocks) and manage their stack levels.

  • StackedItemManager: Manage items stacked on the ground and customize how they merge or display.

  • LootManager: Programmatically interact with the custom loot system, modify loot table definitions, and trigger loot generation.


🔔 Events

VortexStacker fires several custom events that you can listen to in your own plugins:

  • VortexStackerLoadEvent: Fired when the plugin has fully initialized its DI container and is ready to be used.

  • MobStackEvent: Fired when two mobs are about to merge.

  • SpawnerStackEvent: Fired when two spawners are stacked together.

  • LootGenerateEvent: Fired when the custom loot system is calculating drops for an entity.


📄 Plugin.yml

If you are depending on VortexStacker, don't forget to add it to your

plugin.yml to ensure proper load order:

Last updated