HomeJavaModsNekoX
NekoX
ModsJava

NekoX

by _Chinese_Player_ · on Modrinth

A Minecraft Paper plugin that transforms players into cute neko girls with special abilities, combining features from NekoC and toNeko plugins to create a…

⬇ Download on Modrinth

NekoX - Cute Neko Plugin

What is this?

NekoX is a fun Minecraft plugin that makes Minecraft more interesting! It allows players to become cute neko girls with special abilities and interactive features.

Simply put: This plugin adds cute neko characters to your server!

Quick Start (3 Easy Steps)

Step 1: Download the Plugin

  1. Download the NekoX-5.2-ProMax+++.jar file
  2. Place this file in your server's plugins folder

Step 2: Start the Server

  1. Start your Minecraft server normally
  2. The plugin will automatically create configuration files

Step 3: Start Playing

  1. In-game, type /nekoset playername true to turn a player into a neko
  2. Neko players can now use all the fun features!

What Can Nekos Do? (Awesome Features)

🐱 Basic Abilities

💬 Cute Chat

🍖 Special Diet

🐾 Claw Attacks

🛡️ Leather Armor Bonus

Simply put: Leather armor makes nekos run faster!

👑 Owner System

🌙 Night Abilities

💪 Stress Response

⚔️ Passive Attack Boost

Simply put: Neko attacks are more powerful and can knock enemies further!

🌿 Catnip Effects

🛡️ Damage Adjustment

Simply put: Nekos are immune to falling but more vulnerable to attacks!

🐾 Mob Repulsion

Simply put: Creepers and phantoms are afraid of nekos and will automatically avoid them!

👁️ Mob Targeting Behavior

🔔 Player Proximity Notification

Simply put: Nekos receive notifications about nearby players!

🧗‍♀️ Climbing Feature

Simply put: Nekos can climb walls like spiders!

🐾 Tail Pull Feature

Simply put: Players can interact with nekos by pulling their tails!

💖 Health Restore Skill

Simply put: Nekos can heal themselves and their owners with this skill!

📋 Skills List

Simply put: Nekos can view all their skills and cooldowns with this command!

📋 Placeholder System

Simply put: More reliable placeholder system with improved user experience!

🔧 Command System Enhancements

Simply put: More stable commands with correct message display!

🌐 Language System Improvements

Simply put: Enhanced language support with more reliable message handling!

🌿 Catnip Detailed Usage Guide

What is Catnip?

Catnip is a special feature in the NekoX plugin that allows neko players to use specific items to gain temporary buff effects.

🎯 Usage Method

Basic Operation:

  1. Must be a Neko Player - Only players set as nekos can use catnip
  2. Hold Catnip Item - Default uses wheat seeds (WHEAT_SEEDS)
  3. Right-Click to Use - Hold the catnip item and right-click to activate the effect

Specific Steps:

  1. Ensure you are a neko (admin uses /nekoset yourname true to set)
  2. Obtain wheat seeds (or other configured catnip items)
  3. Hold wheat seeds and right-click
  4. Immediately gain speed and jump boost effects

⚡ Effect Details

Catnip provides the following buff effects:

Effect Characteristics:

⚙️ Configuration Options

Customize catnip settings in config.yml:

cat-nip:
  enabled: true           # Enable/disable catnip feature
  item: "WHEAT_SEEDS"     # Catnip item ID (can be changed to other items)
  duration: 60            # Effect duration (seconds)

Modifiable Item Options:

💡 Usage Tips

  1. Combat Assistance - Use during PVP or mob fighting to gain speed and jump advantage
  2. Escape Tool - Use catnip to quickly escape danger when being chased
  3. Exploration Boost - Use during long-distance travel to improve movement efficiency
  4. Building Aid - Jump boost helps with building at heights
  5. Armor Selection - Wear leather armor to get maximum speed bonus

🚫 Limitations

🔄 Synergy with Other Features

Important Note: Right-clicking with catnip in main hand consumes 1 catnip item, off-hand items won't trigger the effect.

Common Commands (In-Game Usage)

Interaction Commands (Everyone can use)

Ability Commands (Nekos only)

Owner System Commands

Admin Commands

New Features in Emergency-fix Version

📋 Placeholder System Improvements

Simple Description: More reliable placeholder system with improved user experience!

🔧 Command System Enhancements

Simple Description: More stable commands with correct message display!

🌐 Language System Improvements

Simple Description: Enhanced language support with more reliable message handling!

Configuration (Optional Settings)

The plugin creates a config.yml file on first run, which you can open and modify with a text editor:

Basic Settings

Ability Adjustments

Special Effects

Developer API

NekoX provides a comprehensive API for other plugins to integrate neko functionality.

API Access

Using NekoX API in your plugin:

  1. Add dependency in plugin.yml:
depend: [NekoX]
  1. Get API instance in your plugin:
import org.cneko.nekox.api.NekoXAPI;

public class YourPlugin extends JavaPlugin {
    private NekoXAPI nekoXAPI;
    
    @Override
    public void onEnable() {
        nekoXAPI = NekoXAPI.getInstance(this);
        if (nekoXAPI == null) {
            getLogger().warning("NekoX plugin not found!");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
    }
}

Development Environment Setup

Since NekoX is not published to JitPack or other public repositories, you need to manually add it to your project:

  1. Maven Project Setup:

    • Create a libs folder in your project directory
    • Copy the NekoX-5.2-ProMax+++.jar file from this plugin's target folder to your libs folder
    • Add the following dependency to your pom.xml:
    <dependency>
        <groupId>org.cneko</groupId>
        <artifactId>NekoX</artifactId>
        <version>5.2-ProMax+++</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/libs/NekoX-5.2-ProMax+++.jar</systemPath>
    </dependency>
    
  2. Gradle Project Setup:

    • Create a libs folder in your project directory
    • Copy the NekoX-5.2-ProMax+++.jar file to your libs folder
    • Add the following dependency to your build.gradle:
    implementation files('libs/NekoX-5.2-ProMax+++.jar')
    
  3. Manual Setup (IDE):

    • Create a libs folder in your project directory
    • Copy the NekoX-5.2-ProMax+++.jar file to your libs folder
    • Add the jar file to your project's build path in your IDE

API Methods

Neko Status Check

Player Retrieval

Owner Relationship Management

Events

NekoX provides custom events for other plugins to listen to:

NekoStatusChangeEvent

Triggered when a player's neko status changes:

@EventHandler
public void onNekoStatusChange(NekoStatusChangeEvent event) {
    Player player = event.getPlayer();
    boolean isNeko = event.isNeko();
    boolean isOnline = event.isOnline();
    // Handle status change
}

OwnerRelationshipEvent

Triggered when owner relationships are added, removed, or requested:

@EventHandler
public void onOwnerRelationshipChange(OwnerRelationshipEvent event) {
    String nekoName = event.getNekoName();
    String ownerName = event.getOwnerName();
    OwnerRelationshipEvent.RelationshipAction action = event.getAction();
    
    switch (action) {
        case ADD:
            // Handle relationship addition
            break;
        case REMOVE:
            // Handle relationship removal
            break;
        case REQUEST:
            // Handle relationship request
            break;
    }
}

🔧 Developer Documentation

💡 Friendly Reminder: If you're just a regular user without programming knowledge, you can skip this section!

Maven Configuration

If you want to develop plugins that integrate with NekoX, here's the Maven configuration you need:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>your.group.id</groupId>
    <artifactId>YourPlugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <name>YourPlugin</name>
    
    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    
    <repositories>
        <!-- PaperMC Repository -->
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</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>
        
        <!-- NekoX API -->
        <!-- Place the NekoX plugin jar file in your project's libs folder -->
        <dependency>
            <groupId>org.cneko</groupId>
            <artifactId>NekoX</artifactId>
            <version>5.2-ProMax+++</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/NekoX-5.2-ProMax+++.jar</systemPath>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

How to Compile the Plugin (For Developers Who Want to Build the Plugin)

If you want to compile the plugin file yourself, you can follow these steps:

For Minecraft 1.20.4 (Default Version)

Open command line and enter:

mvn clean install

For Minecraft 1.21.4

Important Note: You need to install Java 21 on your computer first Open command line and enter:

mvn clean install -Ppaper-1.21.4

Current Limitations

PlaceholderAPI Support

NekoX integrates with PlaceholderAPI and provides the following placeholders (requires PlaceholderAPI plugin to be installed):

Placeholder Description
%nekox_is_neko% Check if player is a neko
%nekox_humans% Get list of non-neko players
%nekox_nekos% Get list of neko players

Use the /nekox placeholders command to view all available placeholders and their status.

Technical Implementation of Damage Adjustment Feature

Core Classes

Implementation Logic

  1. Listen for EntityDamageEvent events
  2. Check if the damaged entity is a neko
  3. If it's fall damage (FALL enum), cancel the damage event
  4. If it's other damage, increase the damage by the configured multiplier

Testing Methods

Technical Implementation of Mob Repulsion Feature

Core Classes

Implementation Logic

Testing Methods

Frequently Asked Questions

Q: Which Minecraft versions are supported?

A: Supports 1.20.4 and 1.21.4 versions

Q: How to turn a player into a neko?

A: Admin types /nekoset playername true

Q: What can nekos do that regular players can't?

A: Night vision, jump boost, sneak speed, special chat, claw attacks, etc.

Q: What's the purpose of the owner system?

A: Nekos can have owners, owners and nekos can heal each other and have special interactions

Q: How to modify plugin settings?

A: Edit the plugins/NekoX/config.yml file

Q: Is Chinese supported?

A: Yes! Type /nekox language chinese to switch to Chinese

Technical Support

If you encounter problems:

  1. Check if Minecraft version matches
  2. Confirm plugin file is in correct location
  3. Check error messages in server logs
  4. Contact plugin developer for help

Tips


NekoX Developer Wiki

Table of Contents

  1. Introduction
  2. Build Configuration
  3. API Access
  4. API Methods
  5. Usage Examples
  6. Event System
  7. Data Storage

Introduction

NekoX is a feature-rich Minecraft neko plugin that adds neko characters and related functionality to servers. This developer Wiki aims to help other plugin developers understand how to integrate with the NekoX plugin.

Build Configuration

Maven Configuration

If you use Maven to build your plugin, add the following configuration to your pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>your.group.id</groupId>
    <artifactId>YourPlugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <name>YourPlugin</name>
    
    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    
    <repositories>
        <!-- PaperMC Repository -->
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</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>
        
        <!-- NekoX API -->
        <!-- Place the NekoX plugin jar file in your project's libs folder -->
        <dependency>
            <groupId>org.cneko</groupId>
            <artifactId>NekoX</artifactId>
            <version>5.2-ProMax+++</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/NekoX-5.2-ProMax+++.jar</systemPath>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Gradle Configuration

If you use Gradle to build your plugin, add the following configuration to your build.gradle file:

plugins {
    id 'java'
}

group = 'your.group.id'
version = '1.0-SNAPSHOT'

repositories {
    // PaperMC Repository
    maven {
        name = 'papermc'
        url = 'https://repo.papermc.io/repository/maven-public/'
    }
    
    mavenCentral()
}

dependencies {
    // Paper API
    compileOnly 'io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT'
    
    // NekoX API
    // Place the NekoX plugin jar file in your project's libs folder
    implementation files('libs/NekoX-5.2-ProMax+++.jar')
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

Manual Configuration

If you don't use build tools, you can directly add the NekoX plugin jar file to your project dependencies:

  1. Copy the NekoX-5.2-ProMax+++.jar file from the NekoX project's target folder
  2. Create a libs folder in your project
  3. Put the NekoX-5.2-ProMax+++.jar file in the libs folder
  4. Add the jar file to your project's build path in your IDE
  5. Make sure to add NekoX as a dependency in plugin.yml

Build and Deployment

After building your plugin, ensure:

  1. Place the generated jar file in the server's plugins folder
  2. Ensure the NekoX plugin is also installed
  3. Restart the server to load all plugins

Multi-Version Support

NekoX supports multiple Minecraft versions:

If you need to build a specific version, you can use Maven profiles:

# Build 1.20.4 version (default)
mvn clean install

# Build 1.21.4 version
mvn clean install -Ppaper-1.21.4

API Access

1. Adding Dependencies

To use the NekoX API in your plugin, first you need to get the API instance:

import org.cneko.nekox.api.NekoXAPI;

// In your plugin main class
public class YourPlugin extends JavaPlugin {
    private NekoXAPI nekoXAPI;
    
    @Override
    public void onEnable() {
        // Get NekoX API instance
        nekoXAPI = NekoXAPI.getInstance(this);
        if (nekoXAPI == null) {
            getLogger().warning("NekoX plugin not found, please ensure NekoX is installed and enabled!");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        
        getLogger().info("Successfully connected to NekoX API!");
    }
}

2. plugin.yml Configuration

Add NekoX as a dependency in your plugin.yml file:

name: YourPlugin
version: 1.0
main: your.package.YourPlugin
api-version: 1.13
depend: [NekoX]

API Methods

Neko Check Methods

boolean isNeko(Player player)

Check if specified player is a neko

Parameters:

Return Value:

boolean isNeko(String playerName)

Check if specified player name is a neko (supports offline players)

Parameters:

Return Value:

Player Retrieval Methods

Set<String> getAllNekoNames()

Get all neko player names (including offline)

Return Value:

Relationship Query Methods

Set<String> getOwnerNames(String nekoName)

Get all owner names of specified neko

Parameters:

Return Value:

boolean isOwnerOf(String ownerName, String nekoName)

Check if specified player is owner of a neko

Parameters:

Return Value:

boolean hasOwner(String playerName)

Check if specified player has an owner

Parameters:

Return Value:

Usage Examples

Example 1: Check if Player is Neko

Player player = ...; // Get player instance
if (nekoXAPI.isNeko(player)) {
    player.sendMessage("You are a cute neko!");
} else {
    player.sendMessage("You are not a neko~");
}

Example 2: Get All Neko Player Names

Set<String> nekoNames = nekoXAPI.getAllNekoNames();
for (String nekoName : nekoNames) {
    // Process each neko player name
    getLogger().info("Neko: " + nekoName);
}

Example 3: Check Owner Relationship

String ownerName = ...; // Owner player name
String nekoName = ...;  // Neko player name

if (nekoXAPI.isOwnerOf(ownerName, nekoName)) {
    getLogger().info(ownerName + " is the owner of " + nekoName + "!");
}

Example 4: Get All Owners of a Neko

String nekoName = ...; // Neko player name
Set<String> owners = nekoXAPI.getOwnerNames(nekoName);

if (owners.isEmpty()) {
    getLogger().info(nekoName + " doesn't have an owner yet~");
} else {
    StringBuilder message = new StringBuilder(nekoName + "'s owners: ");
    for (String owner : owners) {
        message.append(owner).append(", ");
    }
    getLogger().info(message.toString());
}

Event System

NekoX provides some custom events that other plugins can listen to in order to respond to neko-related behaviors.

Available Events

NekoStatusChangeEvent

Triggered when a player's neko status changes

Event Class: org.cneko.nekox.api.events.NekoStatusChangeEvent Trigger Timing: When a player is set as neko or neko status is cancelled

Usage Example:

@EventHandler
public void onNekoStatusChange(NekoStatusChangeEvent event) {
    Player player = event.getPlayer();
    boolean isNeko = event.isNeko();
    boolean isOnline = event.isOnline();
    
    if (isNeko) {
        getLogger().info(player.getName() + " became a neko!");
    } else {
        getLogger().info(player.getName() + " is no longer a neko!");
    }
}

OwnerRelationshipEvent

Triggered when owner relationship changes

Event Class: org.cneko.nekox.api.events.OwnerRelationshipEvent Trigger Timing: When adding, removing, or requesting owner relationship

Usage Example:

@EventHandler
public void onOwnerRelationshipChange(OwnerRelationshipEvent event) {
    String nekoName = event.getNekoName();
    String ownerName = event.getOwnerName();
    OwnerRelationshipEvent.RelationshipAction action = event.getAction();
    
    switch (action) {
        case ADD:
            getLogger().info(ownerName + " became the owner of " + nekoName + "!");
            break;
        case REMOVE:
            getLogger().info(ownerName + " is no longer the owner of " + nekoName + "!");
            break;
        case REQUEST:
            getLogger().info(ownerName + " requested to become the owner of " + nekoName + "!");
            break;
    }
}

Data Storage

NekoX uses SQLite database to store player data, including:

Database Structure

player_configs Table

Store player basic configuration

neko_owners Table

Store neko-owner relationships

owner_requests Table

Store owner request relationships

Notes

  1. All database operations are executed asynchronously and won't block the main thread
  2. It's recommended to access data through API methods rather than directly operating the database
  3. Player data uses player name as identifier and supports offline player queries

Best Practices

Performance Optimization

  1. Cache API instances to avoid repeated retrieval
  2. Use asynchronous operations appropriately to avoid executing time-consuming tasks on the main thread
  3. Release resources in a timely manner, especially when the plugin is disabled

Error Handling

  1. Always check if API instance is null
  2. Handle possible exception cases, such as player not being online
  3. Provide friendly error messages

Compatibility

  1. Check if NekoX plugin exists and is enabled
  2. Adapt to different versions of NekoX API
  3. Provide fallback solutions and alternative logic when NekoX is unavailable

Support and Feedback

If you encounter problems or have improvement suggestions while using the NekoX API, please contact us through the following methods:

Thank you for using NekoX!


NekoX - 可爱的猫娘插件

这是什么?

NekoX是一个让Minecraft变得更有趣的插件!它可以让玩家变成可爱的猫娘,拥有特殊能力和互动方式。

简单来说: 这个插件让你的服务器里出现可爱的猫娘角色!

快速开始(3步搞定)

第1步:下载插件

  1. 下载 NekoX-5.2-ProMax+++.jar 文件
  2. 把这个文件放到你服务器的 plugins 文件夹里

第2步:启动服务器

  1. 正常启动你的Minecraft服务器
  2. 插件会自动创建配置文件

第3步:开始使用

  1. 在游戏里输入 /nekoset 玩家名字 true 把玩家变成猫娘
  2. 猫娘玩家就可以使用各种有趣的功能啦!

猫娘能做什么?(超有趣的功能)

🐱 基础能力

💬 可爱聊天

🍖 特殊饮食

🐾 爪子攻击

🛡️ 皮革护甲加成

简单来说: 皮革护甲让猫娘跑得更快!

👑 主人系统

🌙 夜间能力

💪 应激反应

⚔️ 被动攻击增强

简单来说: 猫娘的攻击更有力,能把敌人打得更远!

🌿 猫薄荷效果

🛡️ 伤害调整

简单来说: 猫娘不怕摔,但更容易受伤!

🐾 生物驱赶

简单来说: 苦力怕和幻翼都怕猫娘,会自动躲开!

👁️ 生物目标行为

🔔 玩家接近提醒

简单来说: 猫娘会在动作栏中实时收到附近玩家的通知!

🧗‍♀️ 爬墙功能

简单来说: 猫娘可以像蜘蛛一样在墙壁上爬行!

🐾 尾巴拉扯功能

简单来说: 玩家可以和猫娘进行尾巴拉扯的互动!

💖 健康恢复技能

简单来说: 猫娘可以用这个技能治疗自己和主人!

📋 技能列表

简单来说: 猫娘可以通过这个命令查看所有技能和冷却时间!

📋 占位符系统

简单来说: 更可靠的占位符系统,提升用户体验!

🔧 命令系统增强

简单来说: 更稳定的命令,消息显示正确!

🌐 语言系统改进

简单来说: 增强的语言支持,消息处理更可靠!

🌿 猫薄荷详细使用指南

什么是猫薄荷?

猫薄荷是NekoX插件中的一个特殊功能,让猫娘玩家使用特定物品获得临时增益效果。

🎯 使用方法

基本操作:

  1. 必须是猫娘玩家 - 只有被设置为猫娘的玩家才能使用猫薄荷
  2. 手持猫薄荷物品 - 默认使用小麦种子(WHEAT_SEEDS)
  3. 右键使用 - 手持猫薄荷物品右键点击即可激活效果

具体步骤:

  1. 确保你是猫娘(管理员使用 /nekoset 你的名字 true 设置)
  2. 获取小麦种子(或其他配置的猫薄荷物品)
  3. 手持小麦种子右键点击
  4. 立即获得速度和跳跃提升效果

⚡ 效果详情

猫薄荷提供以下增益效果:

效果特点:

⚙️ 配置选项

config.yml 中可以自定义猫薄荷设置:

cat-nip:
  enabled: true           # 是否启用猫薄荷功能
  item: "WHEAT_SEEDS"     # 猫薄荷物品ID(可修改为其他物品)
  duration: 60            # 效果持续时间(秒)

可修改的物品选项:

💡 使用技巧

  1. 战斗辅助 - 在PVP或打怪时使用,获得速度和跳跃优势
  2. 逃跑利器 - 被追击时使用猫薄荷快速脱离危险
  3. 探索加速 - 长途旅行时使用,提高移动效率
  4. 建筑辅助 - 跳跃提升有助于搭建高处建筑
  5. 护甲选择 - 穿皮革护甲可获得最大速度加成

🚫 限制条件

🔄 与其他功能的配合

重要提示: 主手持物右键会消耗1个猫薄荷物品,副手持物不会触发效果。

常用命令(游戏内使用)

互动命令(所有人都能用)

能力命令(只有猫娘能用)

主人系统命令

管理员命令

配置说明(可选设置)

插件第一次运行时会创建 config.yml 文件,你可以用记事本打开修改:

基本设置

能力调整

特殊效果

开发者API

NekoX为其他插件提供了全面的API,以便集成猫娘功能。

API接入

在您的插件中使用NekoX API:

  1. plugin.yml 中添加依赖:
depend: [NekoX]
  1. 在插件中获取API实例:
import org.cneko.nekox.api.NekoXAPI;

public class YourPlugin extends JavaPlugin {
    private NekoXAPI nekoXAPI;
    
    @Override
    public void onEnable() {
        nekoXAPI = NekoXAPI.getInstance(this);
        if (nekoXAPI == null) {
            getLogger().warning("未找到NekoX插件!");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
    }
}

开发环境设置方法

由于NekoX没有发布到JitPack或其他公共仓库,您需要手动将其添加到您的项目中:

  1. Maven项目设置:

    • 在您的项目目录中创建一个 libs 文件夹
    • 将本插件target文件夹中的 NekoX-5.2-ProMax+++.jar 文件复制到您的 libs 文件夹
    • 在您的 pom.xml 中添加以下依赖:
    <dependency>
        <groupId>org.cneko</groupId>
        <artifactId>NekoX</artifactId>
        <version>5.2-ProMax+++</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/libs/NekoX-5.2-ProMax+++.jar</systemPath>
    </dependency>
    
  2. Gradle项目设置:

    • 在您的项目目录中创建一个 libs 文件夹
    • NekoX-5.2-ProMax+++.jar 文件复制到您的 libs 文件夹
    • 在您的 build.gradle 中添加以下依赖:
    implementation files('libs/NekoX-5.2-ProMax+++.jar')
    
  3. 手动设置(IDE):

    • 在您的项目目录中创建一个 libs 文件夹
    • NekoX-5.2-ProMax+++.jar 文件复制到您的 libs 文件夹
    • 在您的IDE中将jar文件添加到项目的构建路径

API方法

猫娘状态检查

玩家获取

主人关系管理

事件

NekoX提供了自定义事件供其他插件监听:

NekoStatusChangeEvent

当玩家的猫娘状态改变时触发:

@EventHandler
public void onNekoStatusChange(NekoStatusChangeEvent event) {
    Player player = event.getPlayer();
    boolean isNeko = event.isNeko();
    boolean isOnline = event.isOnline();
    // 处理状态变更
}

OwnerRelationshipEvent

当主人关系添加、移除或申请时触发:

@EventHandler
public void onOwnerRelationshipChange(OwnerRelationshipEvent event) {
    String nekoName = event.getNekoName();
    String ownerName = event.getOwnerName();
    OwnerRelationshipEvent.RelationshipAction action = event.getAction();
    
    switch (action) {
        case ADD:
            // 处理关系添加
            break;
        case REMOVE:
            // 处理关系移除
            break;
        case REQUEST:
            // 处理关系申请
            break;
    }
}

🔧 开发者相关文档

💡 温馨提示:如果您只是普通用户,没有编程基础,可以跳过这部分内容!

Maven配置

如果您想开发与NekoX集成的插件,以下是您需要的Maven配置:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>your.group.id</groupId>
    <artifactId>YourPlugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <name>YourPlugin</name>
    
    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    
    <repositories>
        <!-- PaperMC仓库 -->
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</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>
        
        <!-- NekoX API -->
        <!-- 将NekoX插件jar文件放在项目的libs文件夹中 -->
        <dependency>
            <groupId>org.cneko</groupId>
            <artifactId>NekoX</artifactId>
            <version>5.2-ProMax+++</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/NekoX-5.2-ProMax+++.jar</systemPath>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

如何编译插件(适合想自己构建插件的开发者)

如果您想要自己编译插件文件,可以按照以下步骤操作:

对于 Minecraft 1.20.4(默认版本)

打开命令行,输入:

mvn clean install

对于 Minecraft 1.21.4

重要提示:您需要先在电脑上安装 Java 21 打开命令行,输入:

mvn clean install -Ppaper-1.21.4

当前限制

Verified by MCModsHub

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

Explore more