catgaming_yt.

Develop a speed plugin that allows OP players to use the command /speed <1-10> to set their movement speed, affecting all items they hold. Include configurable speed multipliers, an option to restrict usage to specific worlds, and a cooldown period to prevent spamming the command. und mache das es auch /herz gibt dort kannst du bis zu 20 herzen enschan6ten die du bekommst die sachn gehen nur wen man es in der hand oder off ahnd helt

Kodari AI
KodariApr 19 at 3:47 pm 9,674 (v2)

I’ll create a plugin that allows OP players to enchant items with speed and health boosts using commands. When holding these items, players receive the configured effects.

ItemBoostPlugin
Allows OP players to enchant items with speed and health boosts using /speed and /herz commands. Items marked with boosts grant their effects only when held in main hand or offhand. Features configurable speed multipliers per level (1-10), adjustable max hearts (up to 20), world restrictions, and per-command cooldowns to prevent spam. Perfect for creating custom gear with special movement and health bonuses.

Created a complete item boost plugin with speed and health enchantment commands!

Features implemented:

  • /speed <1-10> - Marks held items with speed levels (configurable multipliers)

  • /herz <hearts> - Marks held items with max health (up to 20 hearts)

  • Effects only active when holding items in main hand or offhand

  • World restrictions (whitelist/blacklist mode)

  • Per-command cooldowns to prevent spam

  • Persistent data storage using PersistentDataContainer

  • Cross-version compatibility with XSeries

How it works:

  1. Player holds an item and uses /speed 10 → item gets tagged with speed level 10

  2. Whenever player holds that item (main or offhand), they receive the speed boost

  3. Same for /herz 15 → grants 15 hearts (30 HP) when held

  4. Boosts automatically apply/remove when switching items

All configuration values are customizable in config.yml, including individual speed multipliers for each level!

catgaming_yt.

man bekommt keinen speed und extra herzen also auch keine enchantments

Kodari AI
KodariApr 19 at 3:53 pm 6,525 (v2)

Ich werde die Dateien lesen, um das Problem zu finden.

Ich sehe das Problem! Der Listener aktualisiert die Boosts nur beim Wechseln von Items, aber nicht beim Einloggen, Respawn oder nach einem Reload. Außerdem fehlen wichtige Events.

Die Änderungen beheben das Problem durch:

  1. PlayerJoinEvent - Boosts werden beim Einloggen angewendet

  2. PlayerRespawnEvent - Boosts werden nach dem Tod wiederhergestellt

  3. PlayerChangedWorldEvent - Boosts werden beim Weltwechsel aktualisiert

  4. PlayerDeathEvent - Boosts werden beim Tod entfernt

  5. Delays bei allen Events - Vermeidet Timing-Probleme

  6. removeBoosts() Methode - Setzt Speed und Health ordnungsgemäß zurück

Jetzt sollten die Speed- und Herz-Boosts sofort funktionieren, wenn du ein Item mit den Enchantments in der Hand hältst!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 692
src/main/java/com/itemboost/ItemBoostPlugin.java
package com.itemboost;

import com.itemboost.commands.HerzCommand;
import com.itemboost.commands.SpeedCommand;
import com.itemboost.listeners.ItemHoldListener;
import com.itemboost.managers.ConfigManager;
import com.itemboost.managers.CooldownManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ItemBoostPlugin extends JavaPlugin {
    
    private ConfigManager configManager;
    private CooldownManager cooldownManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.cooldownManager = new CooldownManager();
        
        registerCommands();
        registerListeners();
        
        getLogger().info("ItemBoostPlugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("ItemBoostPlugin has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("speed").setExecutor(new SpeedCommand(this));
        getCommand("herz").setExecutor(new HerzCommand(this));
    }
    
    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new ItemHoldListener(this), this);
    }
}