raffa Anwar
📎 1 file 3,653 chars
📄
pasted-code-1794626591628.txt
txt 115 lines
▶
# ZynxCarry v3.1.0

Develop an advanced Minecraft mob carrying plugin named **ZynxCarry** for Paper 1.21.11 using Java 21.

This is an upgrade from ZynxCarry v3.0.0. Keep all existing features and add the new Monster Carry and Iron Golem Carry systems.

## 1. Carry System
- Players can carry up to 5 mobs simultaneously.
- Java players use Shift + Right Click to pick up mobs.
- Bedrock players use touch-compatible controls through Geyser.
- Players can carry mobs without a distance limit.
- Mobs visually follow the player while being carried.
- Players can release all carried mobs simultaneously.
- Released mobs must spawn safely around the player.

## 2. Supported Mobs

**Animals:**
Cow, Pig, Sheep, Chicken, Rabbit, Wolf, Cat, Fox, Horse, Donkey, Goat, Panda, Turtle, and other configurable animals.

**Monsters:**
Zombie, Skeleton, Creeper, Spider, Cave Spider, Enderman, Witch, Slime, Magma Cube, Drowned, Husk, Stray, Pillager, Vindicator, Evoker, Ravager, Phantom, Blaze, Ghast, Piglin, Hoglin, Zoglin, Guardian, and Elder Guardian.

**Special Mob:**
Iron Golem.

Boss mobs such as Ender Dragon and Wither must remain disabled by default.

## 3. Heavy Carry System

Carrying mobs must reduce player movement speed based on their weight.

**Animal Weight:**
- Each animal = 1 weight.

**Monster Weight:**
- Each monster = 2 weight.

**Iron Golem Weight:**
- Each Iron Golem = 5 weight.

Movement speed based on total weight:

- 1 weight = 100% speed.
- 2 weight = 85% speed.
- 3 weight = 70% speed.
- 4 weight = 55% speed.
- 5 weight = 40% speed.
- 6 weight = 30% speed.
- 7 weight = 20% speed.
- 8 weight = 15% speed.
- 9 weight = 10% speed.
- 10 or more weight = 5% speed.

The weight and movement speed values must be configurable in config.yml.

Restore the player's original movement speed after releasing all mobs.

## 4. Mob Placement System
- Right-click to release all carried mobs simultaneously.
- Bedrock players must have a compatible touch interaction.
- Spawn all mobs around the player in safe positions.
- Mobs must not overlap.
- Preserve mob names, health, age, colors, equipment, and important data.
- If placement fails, keep the mobs safely stored.
- Never duplicate or permanently delete mobs.

## 5. Mob Display System
- Carried mobs must be visible to other players.
- Mob positions must follow the carrier smoothly.
- Support different mob sizes.
- Iron Golem must retain its original visual size.
- Prevent visual glitches and disappearing mobs.

## 6. Commands
- `/carry` - Show plugin help.
- `/carry list` - Show currently carried mobs.
- `/carry drop` - Release all carried mobs simultaneously.
- `/carry reload` - Reload configuration.
- `/carry status` - Show current carrying weight and movement speed.

## 7. Permissions
- `zynxcarry.use`
- `zynxcarry.admin`
- `zynxcarry.bypass`

## 8. Admin Configuration
Administrators can configure:
- Maximum carried mobs (default: 5).
- Animal, monster, and Iron Golem weights.
- Movement speed percentages.
- Allowed and blocked mobs.
- Cooldown.
- Java and Bedrock controls.
- Placement settings.
- Plugin messages.

All settings must be stored in config.yml.

## 9. Java and Bedrock Compatibility
- Support Java Edition.
- Support Bedrock Edition through Geyser and Floodgate.
- Java controls must work correctly.
- Bedrock controls must be designed for mobile touchscreens.
- No client-side mods or addons required.
- Test both Java and Bedrock interactions.

## 10. Technical Requirements
- Minecraft Paper 1.21.11.
- Java 21.
- Maven project.
- Generate a working plugin JAR.
- Keep all v3.0.0 features.
- No fake commands or incomplete features.
- Prevent mob
Kodari AI
KodariNov 14 at 3:29 am 3
ZynxCarry
Advanced mob carrying plugin for Paper 1.21.11 allowing players to pick up and carry up to 5 mobs simultaneously using Shift+Right Click (Java) or touch controls (Bedrock via Geyser). Supports animals, monsters, and Iron Golems with a weight-based movement speed reduction system. Features smooth visual mob following, safe placement on release, data preservation, configurable weights and speeds, admin commands, permissions, and full Java/Bedrock compatibility. Includes heavy carry mechanics where total weight determines player speed percentage, with configurable values in config.yml.
  1. Create the Maven/Paper 1.21.11 plugin scaffold and configurable defaults.

  2. Implement entity carrying, safe all-or-nothing placement, weight-based speed, and optional Floodgate touch controls.

  3. Add the /carry command, event handling, and lifecycle cleanup.

Implemented ZynxCarry 3.1.0 as a Maven project for Paper 1.21.11 and Java 21.

  • Added mob carrying with configurable limits, weights, speed penalties, allowed/blocked mobs, cooldowns, and Java/Bedrock controls.

  • Carried mobs remain the original live entities, preserving their names, health, age, colors, equipment, and other entity data. Release checks for safe, non-overlapping positions; if any mob can’t be placed, the group stays carried.

  • Added /carry, list, drop, status, and admin-only reload. Bedrock-specific controls use Floodgate when installed.

To generate the JAR, click Compile in the top bar, then click Compile in the window that opens. Download it from the successful build result.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
7 1,030
src/main/java/com/zynxcarry/ZynxCarryPlugin.java
package com.zynxcarry;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.geysermc.floodgate.api.FloodgateApi;

import java.util.List;
import java.util.Map;
import java.util.UUID;

public final class ZynxCarryPlugin extends JavaPlugin {
    private CarryManager carryManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        carryManager = new CarryManager(this);
        Bukkit.getPluginManager().registerEvents(new CarryListener(this, carryManager), this);
        CarryCommand carryCommand = new CarryCommand(this, carryManager);
        getCommand("carry").setExecutor(carryCommand);
        getCommand("carry").setTabCompleter(carryCommand);

        Bukkit.getWorlds().forEach(world -> carryManager.recoverStaleEntities(world.getEntities()));
    }

    @Override
    public void onDisable() {
        if (carryManager != null) {
            carryManager.shutdown();
        }
    }

    public CarryManager getCarryManager() {
        return carryManager;
    }

    public void reloadPluginConfig() {
        reloadConfig();
        carryManager.refreshSettings();
    }

    public boolean isBedrockPlayer(Player player) {
        if (!Bukkit.getPluginManager().isPluginEnabled("floodgate")) {
            return false;
        }
        try {
            return FloodgateApi.getInstance().isFloodgatePlayer(player.getUniqueId());
        } catch (LinkageError | RuntimeException exception) {
            return false;
        }
    }

    public void sendMessage(CommandSender sender, String path, Map<String, String> replacements) {
        String prefix = getConfig().getString("messages.prefix", "");
        String message = getConfig().getString("messages." + path, "");
        for (Map.Entry<String, String> replacement : replacements.entrySet()) {
            message = message.replace("%" + replacement.getKey() + "%", replacement.getValue());
        }
        sender.sendMessage(color(prefix + message));
    }

    public void sendHelp(CommandSender sender) {
        List<String> lines = getConfig().getStringList("messages.help");
        String prefix = getConfig().getString("messages.prefix", "");
        for (String line : lines) {
            sender.sendMessage(color(prefix + line));
        }
    }

    private String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }
}