SupremeDev
  • Supreme Development
  • Important
    • Installation
    • PayPal + Google Pay
    • Server Owner Advice
    • Json - Why?
    • Free Client Plugins
      • Supreme KillHolograms
        • config.yml
      • Supreme EXPShop
        • Commands & Permissions
        • config.yml
      • Supreme DeathBans
        • Commands & Permissions
        • config.yml
        • lang.yml
  • Plugins
    • Supreme Factions
      • Placeholders
      • Commands & Permissions
      • Developer API
      • Files
        • raids.json
        • lang.yml
        • conf.json
        • config.yml
        • upgrades.yml
    • Supreme Spawners
      • Commands & Permissions
      • Developer API
      • Files
        • lang.json
        • conf.json
        • entity-settings.json
        • stacker-settings.json
    • Supreme Hoes
      • Commands & Permissions
      • Placeholders
      • Developer API
      • Files
        • config.yml
        • captcha.yml
        • menus.yml
    • Supreme Printer
      • Commands & Permissions
      • Developer API
      • Files
        • config.yml
    • Supreme Blood Orbs
      • Commands & Permissions
      • Files
        • config.yml
        • lang.yml
    • Supreme TokenShop
      • Commands & Permissions
      • config.yml
    • Supreme LMS
      • Commands & Permissions
      • Files
        • lang.json
        • config.json
    • Supreme Roam
      • Commands & Permissions
      • Files
        • lang.yml
        • config.yml
    • Supreme MobSwords
      • Commands & Permissions
      • Placeholders
      • Files
        • menus.yml
        • config.yml
    • Supreme BindIP
      • Commands & Permissions
    • Supreme Robots
      • Commands & Permissions
      • Developer API
      • Files
        • lang.json
        • config.json
    • Supreme Meteors
      • Commands & Permissions
      • Files
        • config.yml
        • lang.json
    • Supreme Tools
      • Commands & Permissions
      • Files
        • config.yml
    • Supreme Collectors
      • Commands & Permissions
      • Files
        • lang.json
        • config.json
    • Supreme Player Stats
      • Commands & Permissions
      • Statistic Types
      • Files
        • menus.yml
        • config.json
    • Supreme Miner Picks
      • Commands & Permissions
      • Files
        • drops.yml
        • menus.yml
        • config.yml
  • Addons
    • Factions Top
    • Harvest Event
    • Hoe Boosters
  • Libraries
  • SupremeCaptcha
    • Commands & Permissions
    • Files
      • config.json
  • SupremeTokens
    • Commands & Permissions
    • Files
      • lang.json
      • config.json
Powered by GitBook
On this page
  • Environment Setup
  • Spawner API Usage
  • Stacker API Usage

Was this helpful?

  1. Plugins
  2. Supreme Spawners

Developer API

Environment Setup

SupremeSpawners clients can download the API jar in #FAQ. Developers should ONLY have access to the API jar as everything required to use the API is included. Developers will NEVER need the real SupremeSpawners.jar to make addons. To setup your development environment you'll need to import the folliowing.

<!-- Import for SupremeSpawners -->
<dependency>
    <groupId>life.savag3</groupId>
    <artifactId>SupremeFactions</artifactId>
    <version>1.0.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/dependencies/SupremeSpawners-API.jar</systemPath>
</dependency>

<!-- Import for SupremeCommons -->
<dependency>
    <groupId>me.savag3</groupId>
    <artifactId>Commons</artifactId>
    <version>1.0.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/dependencies/SupremeCommons-API.jar</systemPath>
</dependency>

Since we do not shade commons into each plugin jar you'll need to import it separately.

Spawner API Usage

// Get a Spawner Object
// You can also get spawners by Block, Id, Chunk, and nearby a player
Spawner spawner = Spawners.getInstance().getByLocation(org.bukkit.Location);

Spawner Events

CachePreSpawnEvent - Called before the server spawn a cache of entities from the last tick. This even is cancellable, and includes a reference to the cache itself & all the entities it contains.

SpawnerBreakEvent - Called when a spawner is broken by a player.

SpawnerExplodeEvent - Called when a spawner block is broken by an explosion.

SpawnerPlaceEvent - Called when a spawner is placed by a player.

SpawnerUpgradeEvent - Called when a spawner is upgraded by a player.

Stacker API Usage

// Get a stacked entities reference by Entity
StackedObject object = StackedEntities.of(entity);

if (object instanceOf StackedEntity) {
    StackedEntity stackedEntity = (StackedEntity) object;
    stackedEntity.incrementStack(10); // Adds 10 to the stack size
    stackedEntity.decrementStack(11); // Removed 10 from the stack
    // If removeAmount > stackSize the entity is removed.
}

if (object instanceOf StackedItem) {
    StackedItem stackedItem = (StackedItem) object;
    stackedItem.incrementStack(10); // Adds 10 to the stack size
    stackedItem.decrementStack(11); // Removed 10 from the stack
    // If removeAmount > stackSize the entity is removed.
}

Stacker Events

StackedEntityDeathEvent - Called when a stacked entities size is <= 0 and the entity is removed.

StackedEntityDecayEvent - Called when a stacked entity is decremented.

PreviousCommands & PermissionsNextFiles

Last updated 3 years ago

Was this helpful?