-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Effects
github-actions[bot] edited this page Jan 3, 2026
·
4 revisions
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.
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
}
}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));
}Now players/server owners can use your effect in their effects/*.yml files:
Levels:
- Cost: ...
Effects:
- Type: MY_CUSTOM_EFFECT
Boost: 2.5If 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"Beacon.yml
All Beacon Effects
- 1. Potion Effect
- 2. Immortality Field
- 3. Potion Duration Boost
- 4. Flight
- 5. Magnet
- 6. Spawner Boost
- 7. Crops Boost
- 8. Keep Chunk Loaded
- 9. Apply Mending
- 10. Command Executor
- 11. Glow
- 12. Attribute Modifier
- 13. Cooldown Reduction
- 14. EXP Boost
- 15. EXP Gain
- 16. Extra Power
- 17. Extra Range
- 18. Fire Control
- 19. Furnace Boost
- 20. Permission
- 21. Prevent Mob Spawning
- 22. Saturation
- 23. Stupid AI