> For the complete documentation index, see [llms.txt](https://docs.mantic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mantic.dev/dtc.md).

# Destroy The Core

![](/files/33bda305fe548036bb054a1deefa1414772cf4e6)

🛒 [mantic.dev/product/manticprotector](http://mantic.dev/product/manticprotector) - $10.00

🔐 Requires ManticLib (free) and supports from 1.8 upwards

## Destroy The Core Plugin Overview

Introducing **Mantic Destroy The Core**, an event plugin made to help server owners drive massive player engagement and competitive PvP across any gamemode. It allows teams or players to compete to break a central core block a set number of times to claim epic rewards like custom items or commands. It helps you seamlessly automate highly contested events with customizable schedules, boss bars, and player leaderboards. If you want a flexible, reliable way to keep your community active and battling for loot on any server type, Destroy The Core has you covered.

## Key features of Destroy The Core

* **Automated Event Scheduling**
  * *Server owners can configure specific cores to start automatically at designated times using a 24-hour clock format.*
  * *Players can use the in-game schedule command to view a live countdown to all upcoming events.*
* **Dynamic Hologram Support**
  * *The plugin can display a floating hologram above the core block that tracks the remaining block breaks required to win.*
  * *It seamlessly integrates with popular external hologram plugins, specifically DecentHolograms and HolographicDisplays.*
* **Advanced Reward System**
  * *Administrators can set up a weighted drop system to give randomized rewards to the winning player.*
  * *Rewards can be configured as guaranteed drops, and there is an optional setting to prevent duplicate rewards from being given to the same player during a single win.*
  * *When a player wins, the rewards execute custom console commands that can utilize player name placeholders.*
* **In-Game Setup Wand**
  * *Administrators can use a dedicated in-game configuration wand tool to easily select a physical block and register it as a new core location.*
  * *The command system allows admins to seamlessly create, manually start, force stop, delete, or directly teleport to any registered core without touching the config files.*
* **Comprehensive Player Statistics**
  * *The plugin automatically tracks and stores the total number of core wins for each individual player.*
  * *Players can view their own win statistics, and administrators have access to commands for viewing leaderboards or wiping specific player data.*
* **Multi-Database Storage**
  * *Server owners can choose exactly how gift card and player data is stored, with full support for local JSON files, SQLite, or high-performance MySQL databases.*
* **Extensive Customization**
  * *Almost every aspect of the event can be customized per core, including the block material required and the total number of breaks needed to win.*
  * *Global settings allow full customization of chat messages, command aliases, and specific sound effects for when a core is hit or destroyed.*

## Developer Section (ProtectorAPI#)

```
» DTCAPI#getActiveEvents() - Returns a collection of all currently active Destroy The Core events (ActiveDTC objects).  
» DTCAPI#isEventActive(String) - Checks whether a specific core (by its internal key) is currently running.  
» DTCAPI#getActiveData(String) - Fetches the active event data (ActiveDTC) for a specific core key, if it is currently active.  
» DTCAPI#getCoreData(String) - Retrieves the underlying configuration data (SubDestroyTheCore) for a registered core.  
» DTCAPI#startEvent(SubDestroyTheCore, CommandSender) - Programmatically starts a specific DTC event and triggers the API start event.  
» DTCAPI#stopEvent(SubDestroyTheCore, CommandSender) - Programmatically force-ends an active DTC event.  
» DTCAPI#isDTCBlock(Block) - Evaluates whether a given block is the physical core block for any currently running event.  
» DTCAPI#getActiveByLocation(Location) - Returns the active event data (ActiveDTC) associated with a specific physical location, if one exists.  
» DTCAPI#getCoreByBlock(Block) - Retrieves the core configuration data (SubDestroyTheCore) associated with a specific block in the world.  
» DTCAPI#getWins(Player|UUID|OfflinePlayer) - Fetches the total number of recorded core wins for the specified player.  
» DTCAPI#addWins(UUID, long) - Adds a specified amount of wins to a player's overall statistics.  
```

## Events

| Event Class    | Fired When...                                                                                          | Cancelling the event will...                                                                               |
| -------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| CoreBreakEvent | A player successfully mines or hits an active core block                                               | Prevent the core break from registering (the core's health will not decrease and messages won't send).     |
| DTCStartEvent  | A Destroy The Core event is initiated via command, schedule, or the API.                               | Prevent the event from starting and stop the core block from spawning.                                     |
| DTCEndEvent    | An active core event stops, whether by a player winning, an admin force-ending it, or through the API. | Prevent the event from shutting down, leaving the core active in the world.                                |
| DTCWinEvent    | A player lands the final required break on the core block to destroy it.                               | Prevent the win sequence (the player will not receive their rewards and their win stat will not increase). |

## Plugin Example

```java
package <your package>

import dev.mantic.dtc.api.DTCAPI;
import dev.mantic.dtc.api.events.CoreBreakEvent;
import dev.mantic.dtc.api.events.DTCWinEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.entity.Player;

public class DTCIntegrationListener implements Listener {

    @EventHandler
    public void onCoreBreak(CoreBreakEvent event) {
        Player player = event.getPlayer();
        
        // Example: Prevent players with a specific permission/state from hitting the core
        if (player.hasPermission("myplugin.dtc.spectator")) {
            event.setCancelled(true); // Cancels the break so the core takes no damage
            player.sendMessage("You cannot damage the core while in spectator mode!");
        }
    }
    
    @EventHandler
    public void onCoreWin(DTCWinEvent event) {
        Player player = event.getPlayer();
        String coreName = event.getSubDestroyTheCore().getKey();
        
        // Example: Broadcast a custom custom action when someone wins the event
        player.sendMessage("Congratulations on destroying the " + coreName + " core!");
    }
    
    public void displayPlayerStats(Player player) {
        // Use the API to fetch how many times the player has won a DTC event
        long wins = DTCAPI.getWins(player);
        
        if (wins >= 10) {
            player.sendMessage("You are a DTC veteran with " + wins + " wins!");
        } else {
            player.sendMessage("You have " + wins + " core wins. Keep battling!");
        }
    }
}
```
