neoter

stworz plugin naprawiajacy umozliwiajacy przesuwanie itemow w eq na survivalu

Kodari AI
KodariMay 10 at 12:29 pm 2,727 (v2)
InventoryUnlock
A lightweight Survival plugin that restores full inventory interaction freedom. By default, Minecraft restricts certain item movements in the survival inventory (e.g. dragging items onto armor slots, shift-clicking into specific slots). This plugin removes those restrictions, allowing players to freely move, drag, and place items into any inventory slot including armor, offhand, and crafting grid slots without limitations.

Let me analyze what exactly needs to be fixed — Minecraft’s survival inventory blocks dragging items onto armor slots and a few other interactions. I’ll intercept the relevant inventory events and cancel the restrictions.

Plan:

  • Main plugin class registers the listener

  • InventoryListener intercepts InventoryClickEvent, InventoryDragEvent, and InventoryInteractEvent to allow all item movements in the player’s survival inventory

  • The core fix: cancel InventoryClickEvent with SWAP_WITH_CURSOR / drag events are blocked by Bukkit when targeting armor slots — we override that by re-allowing them

The plugin registers a listener that intercepts InventoryClickEvent and InventoryDragEvent at LOWEST priority (before Bukkit’s own cancellation takes effect) and un-cancels any action targeting armor, offhand, or restricted slots — allowing players to freely move any item into any inventory slot on survival.

neoter

a teraz wygeneruj plugin na dayli ktory jest polaczony z get case aby mozna bylo mozna wlozyc klucze

Kodari AI
KodariMay 10 at 12:32 pm 5,307 (v2)

Teraz mam pełny obraz API. Plan:

  • Plugin DailyCrates z komendą /dailycrate i konfiguracją w config.yml

  • Gracz co 24h może odebrać klucz do skrzynki (konfigurowalny crate ID + key ID z PhoenixCrates)

  • Cooldown zapisywany w pliku data.yml (UUID → timestamp)

  • Komenda /dailycrate reload dla adminów

  • Integracja z PhoenixCrates API — daje fizyczny item klucza do ekwipunku

Przepraszam, zacznę od razu poprawnie:

Plugin gotowy. Oto co robi:

  • /dailycrate — gracz odbiera klucz do skrzynki (fizyczny item z PhoenixCrates) raz na 24h (konfigurowalnie)

  • /dailycrate reload — przeładowuje config.yml i dane cooldownów (wymaga dailycrates.admin)

  • Cooldowny zapisywane są w data.yml (UUID → timestamp), przeżywają restart serwera

  • key-id w config.yml musi odpowiadać identyfikatorowi klucza skonfigurowanego w PhoenixCrates

  • PhoenixCrates jest softdepend — plugin załaduje się nawet bez niego, ale wyświetli błąd przy próbie użycia komendy gdy plugin nie jest dostępny

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 461
src/main/java/com/invunlock/InventoryUnlock.java
package com.invunlock;

import org.bukkit.plugin.java.JavaPlugin;

public class InventoryUnlock extends JavaPlugin {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new InventoryListener(this), this);
        getLogger().info("InventoryUnlock enabled.");
    }

    @Override
    public void onDisable() {
        getLogger().info("InventoryUnlock disabled.");
    }
}