E

Develop a fishing enhancement plugin featuring four passive abilities for players: "Master Angler," which increases fish bite speed by a configurable 30%; "Sea's Bounty," boosting treasure catch chance by 20% while reducing junk catch by 20%; "Steady Hands," allowing fishing rods to pull entities and players with a 25% greater force; and "Expert Sailor," making boats move 35% faster with a configurable speed multiplier. Ensure all features have adjustable settings in a user-friendly configuration file for easy customization.

Kodari AI
KodariJul 27 at 1:37 pm 7
AnglersAdvantage
AnglersAdvantage enhances Minecraft fishing with four configurable passive abilities: Master Angler reduces fish bite wait times, Sea's Bounty improves treasure results while reducing junk, Steady Hands increases the pulling force of fishing rods against entities and players, and Expert Sailor improves boat speed. All abilities, percentages, item classifications, permissions, and reload behavior are managed through a clear configuration file.
  1. Create the Gradle project and plugin metadata.

  2. Add configurable ability settings and reload support.

  3. Implement fishing, loot, entity-pulling, and boat-speed mechanics.

  4. Register commands and listeners through the main plugin class.

E

How to get the class

Kodari AI
KodariJul 27 at 1:40 pm 1

The main plugin class is:

Java
com.kodari.anglersadvantage.AnglersAdvantagePlugin

Source file:

Plain Text
src/main/java/com/kodari/anglersadvantage/AnglersAdvantagePlugin.java

Its plugin.yml entry should be:

YAML
main: com.kodari.anglersadvantage.AnglersAdvantagePlugin

From another Bukkit class, you can access the plugin instance with:

Java
AnglersAdvantagePlugin plugin =
        JavaPlugin.getPlugin(AnglersAdvantagePlugin.class);

Import it using:

Java
import com.kodari.anglersadvantage.AnglersAdvantagePlugin;

If you mean the compiled .class file, build the project with Gradle and find it inside the generated plugin JAR under:

Plain Text
build/libs/

The class will be located inside the JAR at:

Plain Text
com/kodari/anglersadvantage/AnglersAdvantagePlugin.class
E

Okay what i want you add way to get the class so

Kodari AI
KodariJul 27 at 1:42 pm 2

Added a static way to access the plugin class instance:

Java
AnglersAdvantagePlugin plugin =
        AnglersAdvantagePlugin.getInstance();

The method added to AnglersAdvantagePlugin is:

Java
public static AnglersAdvantagePlugin getInstance() {
    return instance;
}

Example from another class:

Java
import com.kodari.anglersadvantage.AnglersAdvantagePlugin;

public void example() {
    AnglersAdvantagePlugin plugin =
            AnglersAdvantagePlugin.getInstance();

    plugin.getLogger().info("Plugin accessed successfully.");
}

The instance is initialized automatically in onEnable().

E

OKAY THIS ALL GOING TO BE ON A CLASS AND CLASS HAS THIS PASSIVES NOW MAKE IT

Kodari AI
KodariJul 27 at 1:47 pm 11
  1. Add a player class that owns all four fishing passives.

  2. Make passive checks use that class instead of applying globally.

  3. Expose the class and its passive settings through the plugin API/configuration.

The plugin now routes ability checks through a single AnglerClass; I’m adding that class as the owner of the four configurable passives and exposing it from the main plugin.

Implemented a dedicated AnglerClass containing all four passives:

Java
import com.kodari.anglersadvantage.AnglersAdvantagePlugin;
import com.kodari.anglersadvantage.classification.AnglerClass;

AnglerClass anglerClass =
        AnglersAdvantagePlugin.getInstance().getAnglerClass();

The class provides:

Java
anglerClass.hasMasterAngler();
anglerClass.getBiteSpeedBonus();

anglerClass.hasSeaBounty();
anglerClass.getTreasureCatchBonus();
anglerClass.getJunkCatchReduction();
anglerClass.getTreasureItems();
anglerClass.getJunkItems();

anglerClass.hasSteadyHands();
anglerClass.getPullForceMultiplier();

anglerClass.hasExpertSailor();
anglerClass.getBoatSpeedMultiplier();

FishingListener now gets all passive values from AnglerClass, rather than reading the configuration directly. The configurable values remain in config.yml, and /fishenhancements reload updates the class behavior automatically.

E

SO HOW DO I GET THE CLASS LIKE THE OMMAND FOR IT

Kodari AI
KodariJul 27 at 1:54 pm 29
  1. Add an in-game /anglerclass command that displays the player’s active class and all four passives.

  2. Register the command and aliases in plugin.yml.

  3. Register its executor in the main plugin class.

Use this command in-game:

Plain Text
/anglerclass

Aliases:

Plain Text
/fishingclass
/passives

It will show the Angler class and the enabled/disabled status of Master Angler, Sea’s Bounty, Steady Hands, and Expert Sailor.The command registration is in place, but the command source file needs to be separated correctly: I’m restoring the reload command and creating the new class command as its own file.

Use:

Plain Text
/anglerclass

Aliases:

Plain Text
/fishingclass
/passives

The command displays the player’s Angler class and all four passive abilities.

Admin reload remains:

Plain Text
/fishenhancements reload

The reload command source was also cleaned up, and the class command is now registered as:

Java
new ClassCommand(this, anglerClass)
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 573
src/main/java/com/kodari/anglersadvantage/AnglersAdvantagePlugin.java
package com.kodari.anglersadvantage;

import com.kodari.anglersadvantage.classification.AnglerClass;
import com.kodari.anglersadvantage.command.ReloadCommand;
import com.kodari.anglersadvantage.command.ClassCommand;
import com.kodari.anglersadvantage.config.PluginConfig;
import com.kodari.anglersadvantage.listener.FishingListener;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class AnglersAdvantagePlugin extends JavaPlugin {
    private static AnglersAdvantagePlugin instance;
    private PluginConfig pluginConfig;
    private AnglerClass anglerClass;
    private FishingListener fishingListener;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        pluginConfig = new PluginConfig(this);
        pluginConfig.reload();
        anglerClass = new AnglerClass(pluginConfig);

        fishingListener = new FishingListener(this, anglerClass);
        Bukkit.getPluginManager().registerEvents(fishingListener, this);

        PluginCommand command = getCommand("fishenhancements");
        if (command != null) {
            command.setExecutor(new ReloadCommand(this, pluginConfig));
        }

        PluginCommand classCommand = getCommand("anglerclass");
        if (classCommand != null) {
            classCommand.setExecutor(new ClassCommand(this, anglerClass));
        }
    }

    public static AnglersAdvantagePlugin getInstance() {
        return instance;
    }

    public AnglerClass getAnglerClass() {
        return anglerClass;
    }

    @Override
    public void onDisable() {
        if (fishingListener != null) {
            fishingListener.restoreBoatSpeeds();
        }
    }
}