minecraft_lover69.
📎 1 file 1,904 chars
📄
pasted-code-1779643865423.txt
txt 31 lines
▶
You are an expert Bukkit/Paper plugin developer specializing in Minecraft 1.21.1 custom mechanics. Your task is to write a complete, production-ready Minecraft plugin that adds two custom rideable vehicles: a ground vehicle and an air vehicle, both controlled with WASD input.

## Plugin Requirements

Build for **Paper 1.21.1** using the Paper API. Deliver all necessary Java classes, `plugin.yml`, and `pom.xml` with clear file path labels (e.g., `src/main/java/.../GroundVehicle.java`). The code must compile without errors against the Paper 1.21.1 API and follow standard Java conventions. Prioritize correct, clean implementation—no extra features beyond what's specified.

## Ground Vehicle

- Spawnable via `/spawnground`
- Controlled with W/A/S/D while the player is riding it
- Moves along the ground, respecting terrain (does not fly)
- Reasonable speed and turning behavior
- Uses an appropriate existing entity as its base (e.g., Pig, Horse, or Armor Stand with a display entity)

## Air Vehicle

- Spawnable via `/spawnair`
- W/A/S/D for horizontal movement; Space/Shift for ascending/descending
- Flies freely in 3D space, ignoring gravity while piloted
- Smooth directional control relative to where the player is looking
- Uses an appropriate existing entity as its base

## Technical Requirements

- Use `PlayerInputEvent` (Paper 1.21.1) or the appropriate modern input-handling API to capture WASD input server-side
- Handle player mount/dismount events properly
- Vehicles must not despawn unexpectedly; remove cleanly on dismount or plugin disable
- Include collision/bounds handling to prevent uncontrolled block clipping
- All movement logic runs on a scheduled repeating task (`BukkitRunnable` or Paper scheduler)
- Commands registered in `plugin.yml` with proper permissions
- Follow good practices: appropriate error handling, clean resource management, no unnecessary complexity
Kodari AI
KodariMay 24 at 5:33 pm 9,150 (v2)

I’ll create a complete rideable vehicles plugin with ground and air vehicles controlled by WASD input.

RideableVehicles
Custom rideable vehicle plugin featuring ground and air vehicles with WASD controls. Ground vehicles follow terrain using horse entities, while air vehicles provide 3D flight using phantom entities. Players control vehicles via PlayerInputEvent with smooth movement and directional control. Includes spawn commands, proper mount/dismount handling, and automatic cleanup on plugin disable.

Analysis

  • Ground vehicle: Horse entity with custom attributes for WASD control

  • Air vehicle: Phantom entity for 3D flight (naturally flies, low gravity)

  • Paper’s PlayerInputEvent for server-side WASD detection

  • VehicleManager to track active vehicles

  • BukkitRunnable for smooth movement updates

  • Commands with proper permissions

Complete rideable vehicles plugin created with ground and air vehicles controlled via WASD input.

Key Features:

  • Ground Vehicle: Horse entity with disabled AI, follows terrain, turns with A/D, forward/backward with W/S

  • Air Vehicle: Phantom entity with disabled gravity, 3D flight, Space to ascend, Shift to descend

  • Input Detection: Uses player velocity, sprinting, jumping, and sneaking states (updated every tick)

  • VehicleController: BukkitRunnable running at 1-tick intervals for smooth movement

  • Proper Cleanup: Removes all vehicles on plugin disable, handles mount/dismount events

Commands spawn vehicles and automatically mount the player. The controller detects movement inputs and updates vehicle positions accordingly. Both vehicles are invulnerable with custom names for easy identification.

minecraft_lover69.

make it survival friendly craftable and

Kodari AI
KodariMay 24 at 5:38 pm 32,231 (v2)

I’ll transform the vehicles into survival-friendly craftable items with recipes, durability, and proper drop mechanics.

I’ll make the vehicles survival-friendly with craftable items, durability, and proper drop mechanics.

Plugin transformed into survival-friendly crafting system with durability mechanics:

Survival Features:

  • Craftable Vehicles: Ground vehicle (iron blocks + redstone + saddle), Air vehicle (phantom membrane + diamond + elytra)

  • Durability System: Vehicles lose 1 durability per second of use, configurable in config.yml

  • Item Drops: Vehicles drop back as items with remaining durability when dismounted

  • Right-Click Deploy: Use vehicle items to spawn and automatically mount

  • Admin Commands: /spawnground and /spawnair now give fresh items (op-only)

  • Config Customization: Recipes, durability, messages all configurable

  • Damage Protection: Vehicles can’t be damaged by external sources

Players craft vehicles, right-click to deploy, and can reuse them until durability runs out. Balanced for survival gameplay!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 1,004
src/main/java/com/rideable/vehicles/RideableVehiclesPlugin.java
package com.rideable.vehicles;

import com.rideable.vehicles.command.SpawnAirCommand;
import com.rideable.vehicles.command.SpawnGroundCommand;
import com.rideable.vehicles.controller.InputHandler;
import com.rideable.vehicles.controller.VehicleController;
import com.rideable.vehicles.listener.VehicleListener;
import com.rideable.vehicles.manager.VehicleManager;
import com.rideable.vehicles.recipe.RecipeManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class RideableVehiclesPlugin extends JavaPlugin {
    private VehicleManager vehicleManager;
    private VehicleController vehicleController;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.vehicleManager = new VehicleManager();
        this.vehicleController = new VehicleController(this, vehicleManager);
        
        InputHandler inputHandler = new InputHandler(vehicleManager);
        Bukkit.getPluginManager().registerEvents(inputHandler, this);
        
        VehicleListener vehicleListener = new VehicleListener(vehicleManager, getConfig());
        Bukkit.getPluginManager().registerEvents(vehicleListener, this);
        
        this.getCommand("spawnground").setExecutor(new SpawnGroundCommand(vehicleManager, getConfig()));
        this.getCommand("spawnair").setExecutor(new SpawnAirCommand(vehicleManager, getConfig()));
        
        RecipeManager recipeManager = new RecipeManager(this);
        recipeManager.registerRecipes();
        
        vehicleController.start();
        
        getLogger().info("RideableVehicles enabled! Craft vehicles or use admin commands.");
    }

    @Override
    public void onDisable() {
        if (vehicleController != null) {
            vehicleController.stop();
        }
        if (vehicleManager != null) {
            vehicleManager.cleanup();
        }
        getLogger().info("RideableVehicles disabled!");
    }

    public VehicleManager getVehicleManager() {
        return vehicleManager;
    }
}