mfnalex / ArmorEquipEvent

ArmorEquipEvent for Bukkit
https://www.spigotmc.org/threads/armorequipevent-for-spigot-api.545188/
16 stars 6 forks source link
armorequipevent bukkit bukkit-api maven-central spigot spigot-api

ArmorEquipEvent

SpigotMC Thread Javadocs Discord Donate

This is a maintained version of Arnuh's ArmorEquipEvent including some bug fixes and a proper maven artifact.

Maven information

The latest version is available on Maven Central:

<dependency>
  <groupId>com.jeff-media</groupId>
  <artifactId>armor-equip-event</artifactId>
  <version>1.0.3-SNAPSHOT</version>
  <scope>compile</scope>
</dependency>

Please note that you must also shade and relocate the artifact:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-shade-plugin</artifactId>
      <version>3.5.0</version>
      <configuration>
        <relocations>
          <relocation>
            <pattern>com.jeff_media.armorequipevent</pattern>
            <shadedPattern>YOUR.PACKAGE.NAME.armorequipevent</shadedPattern>
          </relocation>
        </relocations>
      </configuration>
      <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>shade</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Usage

To use the ArmorEquipEvent, you first have to register the Listener, for example in your onEnable() method:

import com.jeff_media.armorequipevent.ArmorEquipEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class MyPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        ArmorEquipEvent.registerListener(this);
    }

}

You can now listen to this event, cancel it or change the equipped armor.

Javadocs

Javadocs are available here: https://hub.jeff-media.com/javadocs/armorequipevent

Changes

The following things have changed since the latest version of Arnuh's original ArmorEquipEvent:

Other libraries by me

CustomBlockData

My CustomBlockData library provides a PersistentDataContainer for every block in your world - easily save EVERY information you like inside blocks, without any external storage needed!

MorePersistentDataTypes

Adds a ton of new PersistentDataTypes to use with Bukkit's PersistentDataContainer.

SpigotUpdateChecker

Powerful UpdateChecker for your plugins, with only one line of code.

Discord

If you need help, feel free to join my Discord server and head to #programming-help:

Donate

If you are using this project in your paid plugins, or if you just want to buy me a coffee, I would be happy over a small donation :)

Donate with PayPal