Skip to content

About

Spigot/Paper plugin integrating MythicMobs to orchestrate weekly World Boss events with arena leashing and damage tracking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔌 WorldBoss

Version Minecraft Spigot License

WorldBoss is a Spigot/Paper plugin for Minecraft 1.20+ that manages a weekly World Boss using MythicMobs, featuring a damage tracking system exposed via PlaceholderAPI.

en it

📝 Changelog: See CHANGELOG.en.md for version history.


✨ Features

  • 👾 MythicMobs Integration: Spawns and manages a designated boss from your MythicMobs configuration.
  • 🛡️ Intelligent Leash: Prevents the boss from leaving its arena. Automatically triggers pathfinding navigation back to its spawn point with temporary aggro mechanics if players attack it during return.
  • 🔄 Weekly Auto-Reset: Periodically resets the boss's health and damage leaderboards on a configurable day and time, alerting players with a broadcast.
  • 📊 PlaceholderAPI Support: Integrates with PlaceholderAPI to expose a damage-tracking leaderboard for the top 10 players.
  • 💾 State Persistence: Automatically saves and restores the active boss entity UUID and last-reset timestamp in data.yml to survive server restarts.
  • 🔬 Advanced Error Handling: Disables itself and logs clear errors if the configured world or MythicMobs entity is missing, ensuring stability.

📦 Requirements

  • Java: 17 or higher
  • Server: Spigot 1.20.x or Paper 1.20.x (Paper is recommended)
  • Dependencies:

🚀 Installation

  1. Download the latest WorldBoss-1.0.0.jar from the Releases section.
  2. Put the JAR file inside the server's plugins/ directory.
  3. Ensure that the required dependencies (MythicMobs and PlaceholderAPI) are present.
  4. Restart your server to generate the default configuration files.
  5. Configure plugins/WorldBoss/config.yml according to your preferences.
  6. Reload the plugin configuration using /worldboss reload.

🎮 Commands

Command Description Permission Default
/worldboss spawn Spawns the boss manually (replaces any active boss) worldboss.admin OP
/worldboss reset Instantly resets the boss's health and damage leaderboard worldboss.admin OP
/worldboss info Shows the boss's health, coordinates, and top 10 leaderboard worldboss.admin OP
/worldboss reload Reloads the config.yml file worldboss.admin OP

🔑 Permissions

Permission Description Default
worldboss.admin Full access to all administrative commands OP

⚙️ Configuration

config.yml

Here is the main configuration file generated in plugins/WorldBoss/config.yml:

boss:
  # Internal name of the mob in MythicMobs (must match exactly)
  mythicmobs-name: "WorldDragon"

  # Spawn coordinates
  spawn:
    world: "world"
    x: 0.5
    y: 64
    z: 0.5

  # Maximum distance from spawn point in blocks before leash triggers
  leash-range: 150

  # Max HP of the boss (in internal HP; 2 HP = 1 heart)
  # E.g. 100000 = 50,000 hearts
  max-health: 100000

# Weekly reset schedule
reset:
  # Reset day: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
  day: MONDAY
  # Time of the reset in HH:mm format (server timezone)
  time: "00:00"
  # Broadcast message sent to all players on reset
  broadcast-message: "&c[WorldBoss] Il boss si è rigenerato! &7Tornate a combatterlo!"

# General plugin messages
messages:
  boss-spawned: "&a[WorldBoss] Il boss è apparso nel mondo!"
  boss-out-of-range: "&e[WorldBoss] Il boss sta tornando al suo territorio..."

data.yml

A file containing persistent runtime states, stored in plugins/WorldBoss/data.yml. Do not edit manually:

# UUID of the active boss entity currently in play
boss-uuid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

# ISO-8601 timestamp of the last executed reset
last-reset: "2026-01-15T00:00:00"

📖 How It Works

Damage Tracking & Leaderboard

  • The plugin tracks damage inflicted on the boss by players (both directly and via projectiles) using the EntityDamageByEntityEvent.
  • It accumulates the final damage (after armor reduction) in an in-memory database during the current weekly session.
  • The damage leaderboards automatically reset when the scheduled weekly reset occurs.

Intelligent Leash Mechanism

  • A task runs every 20 ticks (1 second) to calculate the 2D horizontal distance (ignoring height differences to handle uneven terrain) between the boss and its spawn point.
  • If the distance exceeds the leash-range:
    • The boss enters return mode (isReturning = true).
    • Its current target is cleared, and it navigates back using MythicMobs pathfinding API.
    • A broadcast alert is throttled to occur at most once every 30 seconds.
    • If a player attacks the boss during its return, it engages in temporary aggro for 5 seconds before returning to pathfinding.

Weekly Reset Task

  • A scheduler runs every 60 ticks (1 minute) checking if the current time matches the configured day and time.
  • It resets the boss HP to maximum, clears all accumulated damage, sends a broadcast, and updates the last-reset timestamp in data.yml to prevent duplicate reset events.

🔬 Technical Details

Architecture Overview

WorldBoss
├── WorldBossPlugin.java            ← Entry point: registers managers, commands, and tasks
├── config/
│   └── ConfigManager.java          ← Configuration loader & settings validation
├── data/
│   └── DataManager.java            ← Persistent state reader & writer (data.yml)
├── boss/
│   ├── BossManager.java            ← Spawning, leash tracking, and boot UUID recovery
│   └── BossResetTask.java          ← Scheduler task checking for weekly reset times
├── damage/
│   └── DamageTracker.java          ← In-memory damage registers & leaderboard top-10 sorting
├── listener/
│   └── BossDamageListener.java     ← Damage registers handler & temporary leash aggro
└── placeholder/
    └── WorldBossExpansion.java     ← Expansion exposing leaderboard to PlaceholderAPI

Event Flow (Damage Registry)

EntityDamageByEntityEvent triggered
→ Is the damaged entity the World Boss (checked by UUID)?
  → YES
    → Is damager a Player or a Projectile shot by a Player?
      → YES
        → Retrieve final damage (event.getFinalDamage())
        → Add damage to player's total in DamageTracker
        → Cancel boss return if isReturning is true (temp aggro for 5 seconds)

🗂️ Project Structure

WeeklyBoss/
├── src/
│   └── main/
│       ├── java/
│       │   └── com/franchino961/worldboss/
│       │       ├── WorldBossPlugin.java
│       │       ├── boss/
│       │       │   ├── BossManager.java
│       │       │   └── BossResetTask.java
│       │       ├── command/
│       │       │   └── WorldBossCommand.java
│       │       ├── config/
│       │       │   └── ConfigManager.java
│       │       ├── damage/
│       │       │   └── DamageTracker.java
│       │       ├── data/
│       │       │   └── DataManager.java
│       │       ├── listener/
│       │       │   └── BossDamageListener.java
│       │       ├── placeholder/
│       │       │   └── WorldBossExpansion.java
│       │       └── util/
│       │           └── NmsHealthUtil.java
│       └── resources/
│           ├── config.yml
│           └── plugin.yml
├── Docs/
│   ├── CHANGELOG.en.md
│   ├── CHANGELOG.it.md
│   ├── README.it.md
│   └── Worldboss_plugin_spec.md
├── LICENSE
├── pom.xml
└── README.md

🔨 Build

Compile the source code using Maven:

git clone https://github.com/franchino961/WeeklyBoss.git
cd WeeklyBoss
mvn clean package

The compiled .jar file will be generated in target/WorldBoss-1.0.0.jar.


📚 Maven Dependencies

<repositories>
    <!-- Paper -->
    <repository>
        <id>papermc</id>
        <url>https://repo.papermc.io/repository/maven-public/</url>
    </repository>
    <!-- MythicMobs -->
    <repository>
        <id>lumine-releases</id>
        <url>https://mvn.lumine.io/repository/maven-public/</url>
    </repository>
    <!-- PlaceholderAPI -->
    <repository>
        <id>placeholderapi</id>
        <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
    </repository>
</repositories>

<dependencies>
    <!-- Paper API -->
    <dependency>
        <groupId>io.papermc.paper</groupId>
        <artifactId>paper-api</artifactId>
        <version>1.20.4-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <!-- MythicMobs -->
    <dependency>
        <groupId>io.lumine</groupId>
        <artifactId>Mythic-Dist</artifactId>
        <version>5.6.1</version>
        <scope>provided</scope>
    </dependency>
    <!-- PlaceholderAPI -->
    <dependency>
        <groupId>me.clip</groupId>
        <artifactId>placeholderapi</artifactId>
        <version>2.11.6</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

🔗 PlaceholderAPI Integration

To display the top 10 leaderboard, register the expansion and use these placeholders:

Placeholder Return Type Description
%worldboss_top_player_<position>% String Player name at the given rank (1-10)
%worldboss_top_damage_<position>% String Damage total at the given rank (1-10)

Note: Rank damage is formatted with dots as thousands separators (e.g. 1.234.567). Empty ranks return an empty string ("").

Hologram Configuration Example (e.g. DecentHolograms):

&6&lTOP WEEKLY BOSS DAMAGE
&e1. &f%worldboss_top_player_1% &7- &c%worldboss_top_damage_1%
&e2. &f%worldboss_top_player_2% &7- &c%worldboss_top_damage_2%
&e3. &f%worldboss_top_player_3% &7- &c%worldboss_top_damage_3%

❓ FAQ

Q: Is the plugin compatible with Paper?
A: Yes, it is compatible with both Spigot and Paper (we recommend Paper).

Q: Are statistics saved permanently across restarts?
A: Statistics are kept in-memory for the current weekly session. They survive restarts because the active boss entity and last reset timestamp are preserved, but they will reset automatically when the scheduled reset time is reached.

Q: Can players kill the boss?
A: By design, the boss's HP should be set extremely high in config.yml so it cannot be killed before the weekly reset occurs.


🐛 Troubleshooting

The plugin disables itself during startup

  • Check if MythicMobs and PlaceholderAPI are correctly installed and enabled on your server.
  • Verify that the world name specified in config.yml exists.
  • Verify that the mob name specified in config.yml exists in MythicMobs configuration files.

The boss is spawning multiple times

  • The plugin reads the boss's UUID from data.yml to track the entity. If you delete data.yml or if the boss entity is killed/removed outside the plugin, it will spawn a new one next time it is loaded.

📄 License

This project is licensed under the MIT License — see LICENSE for details.


👤 Author

Franchino961 — GitHub


🤝 Contributing

Contributions are welcome!

  • Open an Issue to report bugs or request features.
  • Submit a Pull Request to contribute code directly.

💬 Support

About

Spigot/Paper plugin integrating MythicMobs to orchestrate weekly World Boss events with arena leashing and damage tracking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages