Class VitalStrike

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
stawa.vitalstrike.VitalStrike
All Implemented Interfaces:
io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner, org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.event.Listener, org.bukkit.plugin.Plugin

public class VitalStrike extends org.bukkit.plugin.java.JavaPlugin implements org.bukkit.event.Listener
VitalStrike is a dynamic damage indication plugin for Minecraft servers. This plugin provides customizable damage indicators with various features including:
  • Dynamic damage indicators with customizable styles
  • Combo system with multipliers and ranks
  • Player statistics tracking
  • Per-player preferences
The plugin extends JavaPlugin and implements Listener to handle Bukkit events. It manages core functionality including:
  • Damage indicator display and customization
  • Combat combo system with multipliers and ranks
  • Player statistics and leaderboards
  • Configuration management
  • Event handling for combat and player interactions
  • Hologram management for visual feedback
The plugin requires Paper 1.21.4+ or compatible forks and Java 21 or higher.
Version:
1.5.0
Author:
Stawa
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getDamageFormat(org.bukkit.entity.Player player, String damageType)
    Gets the appropriate damage format for a player based on their permissions.
    Gets the player manager instance.
    Gets the player stats instance.
    void
    onBlockBreak(org.bukkit.event.block.BlockBreakEvent event)
    Handles block breaking events to prevent downed players from breaking blocks and to maintain game balance.
    boolean
    onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args)
    Handles the command.
    void
    Called when the plugin is disabled.
    void
    Called when the plugin is enabled.
    void
    onEntityDamage(org.bukkit.event.entity.EntityDamageEvent event)
    Handles the entity damage event.
    void
    onPlayerInteract(org.bukkit.event.player.PlayerInteractEvent event)
    Handles player interaction events for using items and interacting with blocks.
    void
    onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
    Handles the player join event.
    void
    onPlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
    Handles the player quit event.
    onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
     
    void
    refreshPlayerDamageFormat(org.bukkit.entity.Player player)
    Refreshes a player's damage format based on their permissions.
    void
    Reloads the plugin configuration and related components.
    void
    Resets a player's combo counter
    boolean
    shouldShowDamageIndicator(org.bukkit.entity.Entity entity)
    Checks if an entity should receive damage indicators.

    Methods inherited from class org.bukkit.plugin.java.JavaPlugin

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onLoad, registerCommand, registerCommand, registerCommand, registerCommand, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.plugin.Plugin

    getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
  • Constructor Details

    • VitalStrike

      public VitalStrike()
  • Method Details

    • onEnable

      public void onEnable()
      Called when the plugin is enabled.
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • onDisable

      public void onDisable()
      Called when the plugin is disabled.
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • reload

      public void reload()
      Reloads the plugin configuration and related components.
    • onPlayerJoin

      public void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
      Handles the player join event.
      Parameters:
      event - the player join event
    • onBlockBreak

      public void onBlockBreak(org.bukkit.event.block.BlockBreakEvent event)
      Handles block breaking events to prevent downed players from breaking blocks and to maintain game balance.
      Parameters:
      event - The block break event
    • onPlayerQuit

      public void onPlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
      Handles the player quit event.
      Parameters:
      event - the player quit event
    • onEntityDamage

      public void onEntityDamage(org.bukkit.event.entity.EntityDamageEvent event)
      Handles the entity damage event.
      Parameters:
      event - the entity damage event
    • onPlayerInteract

      public void onPlayerInteract(org.bukkit.event.player.PlayerInteractEvent event)
      Handles player interaction events for using items and interacting with blocks. Manages special item usage and prevents downed players from interacting.
      Parameters:
      event - The player interact event
    • shouldShowDamageIndicator

      public boolean shouldShowDamageIndicator(org.bukkit.entity.Entity entity)
      Checks if an entity should receive damage indicators.
      Parameters:
      entity - the entity to check
      Returns:
      true if the entity should receive damage indicators, false otherwise
    • onCommand

      public boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String label, String[] args)
      Handles the command.
      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
      Overrides:
      onCommand in class org.bukkit.plugin.java.JavaPlugin
      Parameters:
      sender - the command sender
      command - the command
      label - the label
      args - the arguments
      Returns:
      true if the command was handled, false otherwise
    • onTabComplete

      public List<String> onTabComplete(org.bukkit.command.CommandSender sender, org.bukkit.command.Command command, String alias, String[] args)
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter
      Overrides:
      onTabComplete in class org.bukkit.plugin.java.JavaPlugin
    • getPlayerManager

      public PlayerManager getPlayerManager()
      Gets the player manager instance.
      Returns:
      the player manager
    • getPlayerStats

      public PlayerStats getPlayerStats()
      Gets the player stats instance.
      Returns:
      the player stats
    • getDamageFormat

      public String getDamageFormat(org.bukkit.entity.Player player, String damageType)
      Gets the appropriate damage format for a player based on their permissions.
      Parameters:
      player - the player
      damageType - the type of damage
      Returns:
      the formatted damage string
    • refreshPlayerDamageFormat

      public void refreshPlayerDamageFormat(org.bukkit.entity.Player player)
      Refreshes a player's damage format based on their permissions. Call this when a player's permissions change.
      Parameters:
      player - the player to refresh damage format for
    • resetPlayerCombo

      public void resetPlayerCombo(UUID playerId)
      Resets a player's combo counter
      Parameters:
      playerId - the UUID of the player