Skip to content
SirKillian edited this page Oct 9, 2023 · 4 revisions

Getting Started

Before you start using the OxyTowns API, you should ensure that you have:

  1. Installed OxyTowns: OxyTowns must be properly installed on your Minecraft server.
  2. Java Development Environment: You will need a Java development environment to write and compile your plugin. Additionally, we target Java 17
  3. OxyTowns Dependency: You can find our API artifact on JitPack.
    1. Group: com.oxywire
    2. Artifact: oxytowns
    3. Version: {see releases page}

Events

You can listen to our events with the Bukkit event system.

Event Description
TaxCollectionEvent Called when taxes and upkeep are collected.
TownPermissionChangeEvent Called when a town changes permissions.
TownPlayerBanEvent Called when a town bans someone.

Example

public class MyPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        this.getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onTownPlayerBan(TownPlayerBanEvent event) {
        this.getSLF4JLogger().info("{} was banned from {}", event.getOfflinePlayer().getName(), event.getTown().getName());
    }
}

Towns

The API surrounding towns are composed of a few pieces. This includes:

  • Town: The actual town entity.
  • OxyTownsApi: Contains cookbook methods.
  • TownCache: Contains methods related to towns.

Examples

  • Checking if a player has permissions at an area:
    • OxyTownsPlugin.get().getOxyTownsApi().hasPermission(Player, Permission, Location)
  • Getting the town a player is in:
    • OxyTownsPlugin.get().getTownCache().getTownByPlayer(Player)
  • Getting a town at a position:
    • OxyTownsPlugin.get().getTownCache.getTownByLocation(Location)

OxyTowns

Setup

References

Support

Update Log

  • [Updates](link to gist)
Clone this wiki locally