Skip to content

Custom Effects

github-actions[bot] edited this page Jan 3, 2026 · 4 revisions

Custom Effects API

You can create your own custom effects and register them with BeaconPlus. This allow you to implement unique mechanics that players can use in their beacons.

1. Create the Effect Class

Most effects will extend AbstractBeaconTierEffect. If your effect applies periodically to entities, you should also implement PassiveBeaconTierEffect.

import thito.beaconplus.effects.AbstractBeaconTierEffect;
import thito.beaconplus.effects.PassiveBeaconTierEffect;
import thito.beaconplus.config.Section;
import org.bukkit.entity.LivingEntity;
import thito.beaconplus.BeaconData;

public class MyCustomEffect extends AbstractBeaconTierEffect implements PassiveBeaconTierEffect {

    private final double boost;

    public MyCustomEffect(Section section) {
        super(section);
        // Load custom parameters from the effect file
        this.boost = section.getDouble("Boost").orElse(1.0);
    }

    @Override
    public void handle(LivingEntity entity, BeaconData beaconData) {
        // This is called periodically for every entity in range
        // Example: Apply a custom boost
    }

    @Override
    public void handleLeave(LivingEntity entity, BeaconData beaconData) {
        // Called when an entity leaves the beacon's range
    }
}

2. Register the Effect

Register your effect during your plugin's onEnable(). You need to provide a unique ID that will be used in the effect's YAML files.

import thito.beaconplus.BeaconAPI;

public void onEnable() {
    BeaconAPI.getAPI().registerEffect("MY_CUSTOM_EFFECT", section -> new MyCustomEffect(section));
}

3. Use the Effect in YAML

Now players/server owners can use your effect in their effects/*.yml files:

Levels:
  - Cost: ...
    Effects:
      - Type: MY_CUSTOM_EFFECT
        Boost: 2.5

Potion Effects

If you just want to add a new potion effect, you don't need to write code. You can use the built-in POTION_EFFECT type:

Effects:
  - Type: POTION_EFFECT
    Effect: SPEED
    Amplifier: 1
    Duration: "16s"

Server Owner Reference

Installation
Commands & Permissions
Config.yml
Beacon.yml
GUI Reference
All Beacon Effects
All Conditions & Filters
Effect File Structure
Storage Reference

Tutorials

VIP-Only Effects
Custom Recipes
Multi-Tier Economy
MySQL Setup

Player Guide

Getting Started
Managing Beacons
Upgrading Effects
Access Control

Developer Documentation

API Basics
Custom Effects
Team Providers

Clone this wiki locally