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.
I’ll create a cosmetic plugin that gives players a custom corrupted apple with visual effects.
All files created successfully! The plugin provides:
/kernelapple command that gives a golden apple with the
potatosmp:godapplecustom modelCustom 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:godapplemodelUses PersistentDataContainer for reliable item tracking
Fully compatible with Minecraft 1.21.11 and resource pack custom models
There are two adjustments needed:
- 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.
- 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
I’ll fix both issues:
Remove title from inventory/hotbar switching - only show on pickup
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.
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() {
}
}