_badnine

Create a Minecraft plugin compatible with Paper/Spigot for version 1.21.11.

Command

Add a command:

/kernelapple

When a player runs this command, the plugin should internally execute the same behavior as the command:

/give @p golden_apple[item_model="potatosmp:godapple"]

This means the player should receive a Golden Apple that already uses the custom item model potatosmp:godapple, so the apple immediately appears with the custom texture from the resource pack.

Item Customization

After the apple is given, the plugin should modify the same item and apply:

Display Name:

§5Corrupted Apple

Lore (optional description):

§dA mysterious corrupted apple

The plugin must keep the item_model component so the texture potatosmp:godapple continues to work correctly.

Title

When the player receives the apple or equips it in their inventory, show a title only to that player:

§5Corrupted Apple Obtained Drop and Re-Equip

If the player drops the apple and picks it up again or equips it again, the same title should appear again for that player.

Item Detection

The plugin should detect the item using the item model potatosmp:godapple or a custom persistent data tag, so the behavior works even if the apple comes from commands, chests, or other sources.

Visual Effects

When the apple is received or equipped, the plugin can optionally play:

purple particles around the player

a cool sound effect

These effects are purely cosmetic.

Gameplay

The apple should not give any abilities, potion effects, or gameplay advantages.

It is only a visual cosmetic item with a custom model, name, title, particles, and sound.

Compatibility

The plugin must be designed specifically for Minecraft 1.21.11 and should work correctly with resource packs that include the model potatosmp:godapple.

Kodari AI
KodariMar 7 at 10:01 pm 8,802 (v2)

I’ll create a cosmetic plugin that gives players a custom corrupted apple with visual effects.

CorruptedApple
A cosmetic plugin that provides a custom corrupted apple item with the potatosmp:godapple model. Features include a /kernelapple command, custom display name and lore, title notifications when obtained or equipped, purple particle effects, and sound effects. Detects items by custom model or persistent data tag. Purely visual with no gameplay advantages.

All files created successfully! The plugin provides:

  • /kernelapple command that gives a golden apple with the potatosmp:godapple custom model

  • Custom display name (§5Corrupted Apple) and lore (§dA mysterious corrupted apple)

  • Title notification shown when obtained, picked up, or equipped

  • Purple portal particles and magical sound effects

  • Detection works for items created by the command OR any item with the potatosmp:godapple model

  • Uses PersistentDataContainer for reliable item tracking

  • Fully compatible with Minecraft 1.21.11 and resource pack custom models

_badnine

There are two adjustments needed:

  1. The title appears repeatedly when switching the apple in the inventory or hotbar. The title should not trigger every time the player switches to the item. It should only appear once when the apple is first received, or when the player drops it and then picks it up or equips it again.
  1. When the player drops the apple, the dropped apple item itself should have the Glowing effect so it becomes highlighted on the ground and is easy to see. The Glowing effect should apply to the dropped item entity
Kodari AI
KodariMar 7 at 10:17 pm 16,060 (v2)

I’ll fix both issues:

  1. Remove title from inventory/hotbar switching - only show on pickup

  2. Add glowing effect to dropped apple items

  • Track players who have seen the title to prevent repeated displays

  • Add PlayerDropItemEvent listener to apply glowing effect to dropped apple entities

  • Remove title trigger from inventory/hotbar switching events

Adjustments complete: title now only shows once when apple is first picked up, and resets when dropped; dropped apple entities now glow on the ground.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 240
src/main/java/com/corruptedapple/CorruptedApple.java
package com.corruptedapple;

import com.corruptedapple.commands.KernelAppleCommand;
import com.corruptedapple.listeners.AppleListener;
import org.bukkit.plugin.java.JavaPlugin;

public class CorruptedApple extends JavaPlugin {
    
    @Override
    public void onEnable() {
        getCommand("kernelapple").setExecutor(new KernelAppleCommand(this));
        getServer().getPluginManager().registerEvents(new AppleListener(this), this);
    }
    
    @Override
    public void onDisable() {
    }
}