chxso_
📎 1 file 1,810 chars
📄
pasted-code-1789770054493.txt
txt 57 lines
▶
Create a custom Minecraft weapon called **Lassow**.

### Item

* The item is a **Lead**.
* Its display name must be **Lassow**.
* Only **OP players** can obtain/use the Lassow.
* Make sure normal Leads are completely unaffected.
* The Lassow should be uniquely identified so renaming a normal Lead does not activate the weapon.

### Abilities

**Right-click — Throw**

* Throw the Lassow like a cowboy lasso.
* Maximum range: 20 blocks.
* If it hits a player, capture them.
* Create a visible rope connection between the user and the target.
* The target cannot simply walk away while captured.

**Right-click again — Pull**

* Pull the captured player toward the Lassow user.
* Do not teleport them; physically pull them toward the player.

**Crouch + Right-click — Long Throw**

* Swing the Lassow around the player's head briefly.
* Throw it up to 30 blocks.
* If it hits a player, capture them.

**Left-click — Whip**

* Use the Lassow as a short-range whip.
* Deal a small amount of damage and knock the target backward.
* Play a whip sound and particle effect.

### Escape

* The captured player can escape by repeatedly crouching/jumping.
* After enough successful inputs, the Lassow breaks.
* The rope also breaks if the target gets more than 25 blocks away.

### Visuals

* Make the Lassow visibly fly through the air.
* Add rope/particle effects while it is flying.
* Show a visible rope between the user and captured player.
* Add cowboy-style sounds for throwing, hitting, pulling, and breaking.

### Important

* Must work on **Minecraft Java 1.21.11**.
* Only OPs can obtain or use the custom Lassow.
* Normal Leads must work exactly as they normally do.
* Add configurable cooldowns, range, damage, pull strength, and escape requirements.
Kodari AI
KodariSep 18 at 10:24 pm 2
LassowWeapon
Adds a custom cowboy-style Lassow weapon to Minecraft 1.21.11. The item is a Lead with the display name "Lassow", uniquely identified via persistent data so normal Leads remain unaffected. Only OP players can obtain or use it. Right-click throws a visible lasso up to 20 blocks that captures players, creating a rope connection. Right-click again physically pulls captured players toward the user. Crouch plus right-click performs a long throw up to 30 blocks. Left-click whips targets, dealing small damage, knockback, with whip sounds and particles. Captured players escape by crouching or jumping repeatedly, or if the rope stretches beyond 25 blocks. Includes cowboy-style sounds, flying rope visuals, and fully configurable cooldowns, ranges, damage, pull strength, and escape requirements.
  1. Create the Paper/Gradle project and plugin metadata for Java 21 / Minecraft 1.21.11.

  2. Implement a uniquely tagged Lassow item, OP-only command and interaction handling.

  3. Add animated throws, rope particles, capture/pull behavior, whip combat, escape handling, cooldowns, and configurable settings.

Implemented the Lassow plugin from scratch with:

  • Java 21 / Paper 1.21.11 project setup

  • OP-only /lassow give command

  • Unique PersistentDataContainer identification

  • Normal Leads remain unaffected

  • Standard and crouching long throws

  • Visible flying Lead and rope particle effects

  • Player capture and physical pulling

  • Tether distance limit

  • Crouch/jump escape system that breaks the Lassow

  • Short-range whip damage and knockback

  • Configurable cooldowns, ranges, damage, pull strength, sounds, and escape requirements

  • Cleanup on player death, quit, and plugin shutdown

chxso_

how does it work?

Kodari AI
KodariSep 18 at 10:56 pm 1

The Lassow works as a custom, OP-only weapon built on top of the normal Minecraft Lead item.

How it is identified

The plugin marks the special Lead with a hidden custom data value. This means:

  • A normal Lead is not treated as a Lassow.

  • Renaming a normal Lead to “Lassow” does not activate it.

  • Only Leads created by the plugin are recognized.

  • Non-OP players cannot obtain or use the weapon.

Throwing

When the owner right-clicks with the Lassow:

  1. The plugin checks whether the item is the custom Lassow.

  2. It checks the cooldown.

  3. It launches a visible Lead-like projectile in the direction the player is looking.

  4. Particles are created along its path.

  5. The projectile searches for a player within the configured range.

  6. If it reaches or detects a player, that player becomes captured.

A normal throw uses the shorter configured range. Crouching while right-clicking uses the long-throw range and briefly creates a swinging effect before launching.

Capturing and rope behavior

After a player is captured, the plugin stores the relationship between:

  • The Lassow owner

  • The captured target

It then repeatedly draws particles between them to represent the rope.

The target is not simply teleported back. Instead, the plugin checks the distance and applies movement toward the owner when pulling or when the tether needs to prevent the target from walking away.

Pulling

Right-clicking again while the owner has someone captured changes the action from throwing to pulling.

The plugin applies directional velocity to the captured player. This physically moves the target toward the Lassow owner rather than instantly teleporting them.

Whip attack

Left-clicking with the Lassow performs a short-range attack:

  • Nearby players are searched for in front of the owner.

  • The first valid target is damaged.

  • Knockback is applied away from the owner.

  • A whip-style sound and particle effect are played.

  • A separate cooldown prevents rapid repeated use.

Escaping

The captured player can escape by performing the configured escape inputs, such as:

  • Crouching

  • Jumping

Each valid input increases their escape progress. Once the required number of inputs is reached:

  • The capture is removed.

  • The rope effect stops.

  • A breaking sound/effect is played.

  • The Lassow is considered broken or released.

The rope also automatically breaks if the target exceeds the configured maximum tether distance, such as 25 blocks.

Cleanup

The plugin releases captures when necessary, including situations such as:

  • The owner disconnecting

  • The target disconnecting

  • Either player dying

  • The plugin shutting down

  • The rope distance becoming invalid

  • The escape requirement being completed

All behavior is controlled through the configuration, including ranges, cooldowns, damage, pull strength, escape count, and sound settings.

chxso_

when i right click it doesnt throw the lassow and when i pull them its supposed to fling them quick to me and they cant move while lassowed acceot being pulled

Kodari AI
KodariSep 18 at 10:59 pm 2
  1. Fix right-click handling so the Lassow throw is processed reliably.

  2. Make captured targets immobile except during an active pull.

  3. Make pulling a short sustained fling toward the owner with stronger configurable force.

Fixed:

  • Right-click handling now runs even if another plugin cancelled the interaction event.

  • Captured players are locked in place and cannot walk away.

  • Jumping still counts toward escape progress.

  • Pulling now lasts for several ticks instead of applying one weak velocity impulse.

  • Pull strength increased from 1.0 to 1.6, producing a faster fling toward the Lassow owner.

  • Added configurable pull duration:

YAML
pull:
  strength: 1.6
  duration-ticks: 8

Use /lassow give to obtain a newly tagged Lassow, then restart or reload the plugin before testing. Right-click throws it; after capturing someone, right-click again pulls them quickly toward you.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
8 626
src/main/java/com/kodari/lassow/LassowPlugin.java
package com.kodari.lassow;

import java.util.Objects;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;

public final class LassowPlugin extends JavaPlugin {
    private NamespacedKey lassowKey;
    private LassowManager lassowManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        lassowKey = new NamespacedKey(this, "lassow_weapon");
        lassowManager = new LassowManager(this);

        getServer().getPluginManager().registerEvents(new LassowListener(lassowManager), this);
        Objects.requireNonNull(getCommand("lassow")).setExecutor(new LassowCommand(lassowManager));
        lassowManager.start();
    }

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

    public NamespacedKey getLassowKey() {
        return lassowKey;
    }
}