HomeJavaModsShiroCore
ShiroCore
ModsJava

ShiroCore

by tantaihaha4487 · on Modrinth

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21–1.21.11 · Paper⬇ Download for 1.21.10 · Purpur⬇ Download for 1.21–1.21.9 · Purpur
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Build Status Latest Release jitpack badge

ShiroCore

ShiroCore is a powerful library plugin for Minecraft (Spigot/Paper) designed to simplify the creation of complex, interactive player abilities. It provides a robust framework for shift-activated skills, complete with progress bars, event handling, and a clean API, allowing developers to focus on building unique gameplay mechanics.


🛠️ Understanding the Components: Engine vs. API

The ShiroVerse project is composed of two key modules that work together: ShiroCore (the engine) and shiro-api (the developer kit). Understanding their distinct roles is crucial for using the framework effectively.

ShiroCore — The Engine

shiro-api — The Developer Kit


🌟 Core Features

1. Shift Activation System

Create abilities that activate through rapid shift-key spamming (configurable threshold).

2. Ability Manager API

Simplified API for creating and managing shift-activated abilities.

3. Action Bar Utilities

Create stylish action bar messages with multiple design options.

4. Dependency Logger

Professional, consistent dependency error messaging for your plugins.


📦 Installation

As a Server Plugin

  1. Download the latest JAR from Releases
  2. Place in your server's plugins folder
  3. Restart the server

As a Dependency

Add to your pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.tantaihaha4487.ShiroVerse</groupId>
        <artifactId>shiro-api</artifactId>
        <version>v1.21.10-2.0.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Add to your plugin.yml:

depend: [ShiroCore]

🚀 Quick Start

Example 1: Create a Shift-Activated Ability

import net.thanachot.ShiroCore.api.ability.AbilityManager;
import net.thanachot.ShiroCore.api.ability.ShiftAbility;

public class MyPlugin extends JavaPlugin {
    
    @Override
    public void onEnable() {
        // Get the AbilityManager
        AbilityManager manager = AbilityManager.getOrThrow();
        
        // Register your custom ability
        manager.registerAbility(new SuperJumpAbility());
    }
}

// Custom ability class
public class SuperJumpAbility extends ShiftAbility {
    private final Set<UUID> activePlayers = new HashSet<>();
    
    public SuperJumpAbility() {
        super("superjump", item -> 
            item != null && item.getType() == Material.FEATHER
        );
    }
    
    @Override
    public void onActivate(Player player, ItemStack item) {
        activePlayers.add(player.getUniqueId());
        player.sendActionBar(Component.text("Super Jump Activated!")
            .color(NamedTextColor.GREEN));
        player.addPotionEffect(new PotionEffect(
            PotionEffectType.JUMP, 
            Integer.MAX_VALUE, 
            2
        ));
    }
    
    @Override
    public void onDeactivate(Player player) {
        activePlayers.remove(player.getUniqueId());
        player.removePotionEffect(PotionEffectType.JUMP);
    }
    
    @Override
    public boolean isActive(Player player) {
        return activePlayers.contains(player.getUniqueId());
    }
}

That's it! The ability will:


Example 2: Action Bar Messages

import net.thanachot.ShiroCore.api.text.ActionbarMessage;

// Simple loading bar
Component loadingBar = ActionbarMessage.getLoadingBar(currentProgress, maxProgress);
player.sendActionBar(loadingBar);

// Stylized gradient bar
Component gradientBar = ActionbarMessage.getStylizedLoadingBar(
    current, 
    max, 
    NamedTextColor.AQUA,  // filled color
    NamedTextColor.GRAY    // empty color
);

// Minimalist dot bar
Component dotBar = ActionbarMessage.getDotLoadingBar(current, max);

// Alert message
Component alert = ActionbarMessage.getAlert("Warning!", NamedTextColor.RED);

Output Examples:

╞═══▰════╡ 40%          (Default)
【█▓▒░░░░░░░】 40%        (Gradient)
●●●●○○○○○○ 40%          (Dots)
(i) Warning!            (Alert)

Example 3: Dependency Checking

import net.thanachot.shiroverse.api.util.DependencyLogger;
import org.bukkit.plugin.Plugin;

public class MyPlugin extends JavaPlugin {
    
    private static final String REQUIRED_SHIROCORE_VERSION = "2.0.0";
    
    @Override
    public void onEnable() {
        if (!checkShiroCore()) {
            // Plugin will continue but without ShiroCore features
            return;
        }
        
        // Initialize ShiroCore features
        initializeAbilities();
    }
    
    private boolean checkShiroCore() {
        Plugin shiroCore = getServer().getPluginManager().getPlugin("ShiroCore");
        
        if (shiroCore == null) {
            logShiroCoreNotFound();
            return false;
        }
        
        String version = shiroCore.getPluginMeta().getVersion();
        if (!version.contains(REQUIRED_SHIROCORE_VERSION)) {
            logIncompatibleVersion(version);
            return false;
        }
        
        return true;
    }
    
    private void logShiroCoreNotFound() {
        try {
            DependencyLogger.logShiroCoreNotFound(
                getLogger(),
                "MyPlugin",
                REQUIRED_SHIROCORE_VERSION
            );
        } catch (NoClassDefFoundError e) {
            getLogger().warning("ShiroCore NOT FOUND! MyPlugin requires ShiroCore v" 
                + REQUIRED_SHIROCORE_VERSION + "+");
        }
    }
    
    private void logIncompatibleVersion(String foundVersion) {
        try {
            DependencyLogger.logIncompatibleVersion(
                getLogger(),
                foundVersion,
                REQUIRED_SHIROCORE_VERSION
            );
        } catch (NoClassDefFoundError e) {
            getLogger().warning("INCOMPATIBLE ShiroCore VERSION! Found: " 
                + foundVersion + ", Required: v" + REQUIRED_SHIROCORE_VERSION + "+");
        }
    }
}

Benefits:


📚 API Documentation

AbilityManager

// Get the manager
AbilityManager manager = AbilityManager.getOrThrow();

// Register an ability
manager.registerAbility(ShiftAbility ability);

// Unregister an ability
manager.unregisterAbility(String abilityId);

// Get a player's active ability
Optional<ShiftAbility> active = manager.getActiveAbility(Player player);

// Check if player has any ability active
boolean hasAbility = manager.hasActiveAbility(Player player);

// Deactivate all abilities for a player
manager.deactivateAll(Player player);

ShiftActivation (Low-Level API)

// Get the service
ShiftActivation shift = ShiftActivation.getOrThrow();

// Set shift count required
shift.setMaxProgress(10);

// Register materials for shift activation
shift.register(handler, Material.NETHERITE_PICKAXE, Material.DIAMOND_SWORD);

// Check if material is registered
boolean registered = shift.isRegistered(Material.NETHERITE_PICKAXE);

Events

// Listen to shift progress
@EventHandler
public void onShiftProgress(ShiftProgressEvent event) {
    Player player = event.getPlayer();
    int progress = event.getPercentage();
    Component message = event.getActionBarMessage();
    
    // Cancel to prevent default behavior
    event.setCancelled(true);
}

// Listen to shift activation
@EventHandler
public void onShiftActivation(ShiftActivationEvent event) {
    Player player = event.getPlayer();
    ItemStack item = event.getItem();
    
    // Your custom logic
}

DependencyLogger

import net.thanachot.shiroverse.api.util.DependencyLogger;

// Log when ShiroCore is not found
DependencyLogger.logShiroCoreNotFound(
    getLogger(),
    "YourPlugin",      // Your plugin name
    "2.0.0"            // Required ShiroCore version
);

// Log when ShiroCore version is incompatible
DependencyLogger.logIncompatibleVersion(
    getLogger(),
    "1.0.0",          // Found version
    "2.0.0"           // Required version
);

// Log custom dependency errors
DependencyLogger.logDependencyError(
    getLogger(),
    "DEPENDENCY ERROR!",
    "ShiroCore API is required.",
    "Please install ShiroCore v2.0.0+"
);

// Get ShiroCore download URL
String url = DependencyLogger.getShiroCoreUrl();

Output Example:

╔════════════════════════════════════════════════════════════╗
║  ShiroCore NOT FOUND!                                      ║
║  YourPlugin requires ShiroCore v2.0.0+                     ║
║  for abilities to work.                                    ║
║                                                            ║
║  The plugin will continue without ability features.        ║
║                                                            ║
║  Download ShiroCore from:                                  ║
║  → https://modrinth.com/plugin/shirocore                   ║
╚════════════════════════════════════════════════════════════╝

Best Practice - Use with try-catch:

private void checkDependencies() {
    try {
        DependencyLogger.logShiroCoreNotFound(
            getLogger(), "MyPlugin", "2.0.0"
        );
    } catch (NoClassDefFoundError e) {
        // Fallback if DependencyLogger isn't available
        getLogger().warning("ShiroCore required!");
    }
}

---

## 🎨 Action Bar Styles

ShiroCore provides **three beautiful loading bar styles**:

### **1. Default Style**
```java
ActionbarMessage.getLoadingBar(current, max)

╞═══▰════╡ 40%

Features:

2. Gradient Style

ActionbarMessage.getStylizedLoadingBar(current, max, filledColor, emptyColor)

【█▓▒░░░░░░░】 40%

Features:

3. Minimalist Dots

ActionbarMessage.getDotLoadingBar(current, max)

●●●●○○○○○○ 40%

Features:


🏗️ Architecture

ShiroCore
├── api/
│   ├── ability/
│   │   ├── ShiftAbility.java          (Abstract base class)
│   │   └── AbilityManager.java        (Service API)
│   ├── event/
│   │   ├── ShiftProgressEvent.java
│   │   ├── ShiftActivationEvent.java
│   │   └── ShiftEvent.java
│   ├── text/
│   │   └── ActionbarMessage.java
│   ├── util/
│   │   └── DependencyLogger.java      (Dependency logging)
│   └── ShiftActivation.java
└── internal/
    ├── ability/
    │   ├── AbilityManagerImpl.java    (Implementation)
    │   └── AbilityListener.java       (Event handling)
    ├── handler/
    │   └── ShiftActivationHandler.java
    └── system/
        └── ShiftActivationService.java

💡 Use Cases

What You Can Build

Real World Example: SuperPickaxe

Check out the SuperPickaxe-Prototype plugin that uses ShiroCore:


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

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


🔗 Links


✨ Credits

Created by tantaihaha4487 for the ShiroVerse project.

Special thanks to all contributors and the Minecraft development community!


Built with ❤️ for the Minecraft community

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more