neston_r.i.p_first_acc
πŸ“Ž 1 file 23,577 chars
πŸ“„
pasted-code-1791038026390.txt
txt 1006 lines
β–Ά
Create a highly polished Minecraft Java Edition server plugin called "ANOMALIES SMP" inspired by the general concept of SMP ability plugins, gem SMPs, Strength SMPs, and Trim SMPs, but DO NOT directly copy Bliss SMP or any existing plugin. This must feel like its own original system with completely original names, abilities, balancing, GUI design, progression, effects, sounds, and mechanics.

The plugin should have THREE MAIN TABS in its primary GUI:

1. ANOMALIES β€” the Gem system
2. STRENGTH β€” randomized weapon-category powers
3. TRIMS β€” armor-trim powers

The plugin must be survival-friendly, multiplayer-compatible, configurable, persistent across server restarts, and designed around vanilla Minecraft mechanics, particles, sounds, items, entities, potion effects, projectiles, and commands wherever possible.

==================================================
TAB 1 β€” ANOMALIES / GEM SYSTEM
==================================================

The plugin must use the eight gems shown in the provided reference image as inspiration for the visual color identities:

RED, GREEN, YELLOW, WHITE, PINK, ORANGE, PURPLE, CYAN.

Do not simply call them "Red Gem", etc. Give every gem an original anomaly name.

Gem names:

RED = RAVAGER ANOMALY
GREEN = WILD ANOMALY
YELLOW = RADIANT ANOMALY
WHITE = FROST ANOMALY
PINK = HEARTBREAK ANOMALY
ORANGE = INFERNO ANOMALY
PURPLE = VOID ANOMALY
CYAN = TIDAL ANOMALY

Every gem has:
- A unique display name.
- Unique lore.
- Unique GUI color.
- Unique icon.
- Two active abilities.
- Energy consumption.
- Ability cooldowns.
- Custom particle/VFX identity.
- Custom vanilla sound identity.
- A passive identity where appropriate.
- Persistent ownership data.
- A unique description page.

Do NOT require a custom resource pack for the plugin to function. The base version must work with vanilla Minecraft textures and vanilla particles/sounds. A resource pack can optionally improve visuals, but must never be mandatory.

--------------------------------------------------
ENERGY SYSTEM
--------------------------------------------------

Every Anomaly Gem has an Energy Meter.

Starting Energy: 5
Maximum Energy: 10

Energy must be displayed through:
- Action bar.
- Optional boss bar.
- Gem GUI.
- /energy command.

Example:

ANOMALY ENERGY
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘ 5/10

Abilities consume energy.

Recommended default costs:
Ability 1 = 1 Energy
Ability 2 = 2 Energy

Allow these values to be changed in config.yml.

Energy regenerates naturally over time. Default:
+1 Energy every 30 seconds.

Players cannot exceed 10 Energy.

If Energy reaches 0:
- The gem becomes BROKEN.
- Its abilities cannot be used.
- Its passive effects are disabled.
- The gem remains in the player's possession.
- The player must regenerate to at least 1 Energy before the gem becomes active again.

When reaching 1 Energy:
- Play a subtle recovery sound.
- Show an action-bar message:
"ANOMALY RESTORED β€” 1 ENERGY"

Add:
 /energy
 /gem
 /anomalies
 /ability:1
 /ability:2
 /description
 /recipe
 /gemreload

The plugin must prevent players from using abilities when:
- They do not own the correct gem.
- They have insufficient energy.
- The ability is on cooldown.
- They are dead.
- The plugin is disabled.

==================================================
GREEN β€” WILD ANOMALY
==================================================

Keep the basic concept of the Green Gem from the original idea.

ABILITY 1 β€” VINE SNARE

Command:
/ability:1

Energy Cost: 1

The player releases four magical vines toward the targeted player or mob.

The four vines should visually travel toward the target using green particles.

Once they reach the target:
- Four vine-like particle strands wrap around the target.
- The target becomes immobilized.
- Disable walking/jumping/normal movement.
- Duration: 4 seconds.
- Prevent teleporting through normal movement during the effect.
- Do not permanently alter the target's movement speed.

Use vanilla particles such as:
- VILLAGER_HAPPY
- COMPOSTER
- BLOCK_CRUMBLE with leaves/vines where supported.

Use sounds such as:
BLOCK_VINE_PLACE
BLOCK_GRASS_PLACE
ENTITY_PLAYER_ATTACK_STRONG

After the duration, the vines burst apart.

ABILITY 2 β€” VERDANT SANCTUARY

Command:
/ability:2

Energy Cost: 2.

Create a large green circular zone around the caster.

Radius: 6 blocks.

Duration: 19.5 seconds.

Every 3.5 seconds, heal the caster by 1 heart.

Create green particles around the edge of the circle.

The circle should look like a magical forest field.

Use:
- HAPPY_VILLAGER
- COMPOSTER
- SPORE_BLOSSOM_AIR
- FALLING_SPORE_BLOSSOM

Optional subtle leaf particles.

At the beginning play a magical nature sound and at the end play a soft grass/vine sound.

==================================================
RED β€” RAVAGER ANOMALY
==================================================

ABILITY 1 β€” BLOOD RUSH

The player gains Speed II and Strength I for 8 seconds.

During activation, create red dust particles around the player.

Every melee hit during Blood Rush produces a small red impact burst.

Energy Cost: 1.

ABILITY 2 β€” CRIMSON IMPACT

The player charges a red shockwave.

After 1 second, release a forward cone approximately 8 blocks long.

Enemies hit receive damage and Knockback.

Players hit are briefly slowed.

Energy Cost: 2.

VFX should use redstone particles, damage particles, and sweep attacks.

==================================================
YELLOW β€” RADIANT ANOMALY
==================================================

ABILITY 1 β€” SOLAR FLASH

Create a bright yellow flash around the caster.

All nearby hostile targets within 6 blocks receive:
- Brief Blindness.
- Small damage.
- Knockback.

Do not blind the caster.

Energy Cost: 1.

ABILITY 2 β€” SUN SPEAR

Launch a concentrated golden projectile toward the player's target.

On impact:
- Small explosion-like particle burst.
- Fire particles.
- Moderate damage.
- Brief glowing effect.

Do not destroy blocks.

Energy Cost: 2.

==================================================
WHITE β€” FROST ANOMALY
==================================================

ABILITY 1 β€” FROZEN STEP

Freeze nearby enemies for 3 seconds.

Create snowflake-like particles using vanilla particles.

Targets receive Slowness IV and Mining Fatigue temporarily.

Energy Cost: 1.

ABILITY 2 β€” GLACIAL WALL

Create a temporary wall of ice-like particles in front of the player.

The wall remains for 8 seconds.

Players cannot pass through the barrier.

Do not permanently place blocks.

Use invisible collision entities or another safe implementation.

Energy Cost: 2.

==================================================
PINK β€” HEARTBREAK ANOMALY
==================================================

ABILITY 1 β€” SOUL LINK

Link the caster to one target within 12 blocks.

For 7 seconds:
- A portion of damage dealt to the target heals the caster.
- A pink particle beam connects both players.

Energy Cost: 1.

ABILITY 2 β€” HEART PULSE

Release a pink circular pulse.

All allies within 8 blocks receive regeneration.

Enemies receive a short weakness effect.

Energy Cost: 2.

==================================================
ORANGE β€” INFERNO ANOMALY
==================================================

ABILITY 1 β€” FLAME DASH

Dash the player forward.

Leave a trail of flame particles.

Enemies crossed by the dash receive fire damage.

Do not create permanent fire blocks.

Energy Cost: 1.

ABILITY 2 β€” INFERNO RING

Create a 7-block radius fiery ring around the caster for 10 seconds.

Enemies entering the ring take periodic damage.

The caster is immune to this ability's damage.

Energy Cost: 2.

==================================================
PURPLE β€” VOID ANOMALY
==================================================

ABILITY 1 β€” VOID STEP

Teleport the caster up to 12 blocks toward the direction they are looking.

Create portal particles at both locations.

Energy Cost: 1.

ABILITY 2 β€” GRAVITY COLLAPSE

Create a purple gravitational field at the targeted location.

Radius: 6 blocks.

For 5 seconds, nearby enemies are pulled toward the center.

After the pull ends, release a knockback burst.

Energy Cost: 2.

==================================================
CYAN β€” TIDAL ANOMALY
==================================================

ABILITY 1 β€” TIDAL PULL

Fire a cyan wave forward.

Enemies hit are pulled toward the caster.

Add water/bubble particles.

Energy Cost: 1.

ABILITY 2 β€” OCEAN'S GUARD

Create a cyan shield around the caster.

For 10 seconds:
- Resistance I.
- Water Breathing.
- Small regeneration effect.

Create bubble particles around the player.

Energy Cost: 2.

==================================================
GEM TRADER / GEM EXCHANGE
==================================================

Add a special NPC called the ANOMALY TRADER.

Command:
/recipe

This opens a GUI explaining how to obtain an Anomaly Gem.

The recipe should not simply allow infinite free gem switching.

Create an "Anomaly Core" crafting/obtaining item.

Suggested recipe:
- Echo Shard
- Amethyst Shard
- Diamond
- Nether Star fragment concept
- One unique ingredient depending on the gem.

The player can visit the Anomaly Trader to exchange their current gem for another gem.

Add a configurable cooldown to prevent constant switching.

Command:
/gem

opens the player's current Gem interface.

==================================================
TAB 2 β€” STRENGTH SYSTEM
==================================================

When a player selects the STRENGTH tab, they receive:

+3 permanent Strength attribute/power while the system is active.

The player also receives ONE RANDOM weapon category.

Categories:

SWORD
AXE
TRIDENT
SHIELD
ARMOR
MACE
CROSSBOW
BOW
SPEAR

The category is randomly selected when the player first receives Strength.

The category must persist.

Do not allow players to reroll freely unless an administrator resets their category.

Command:
/strength

shows their category.

Command:
/strengthability

activates their category's active ability.

==================================================
NETHERITE ARMOR RULE
==================================================

The ARMOR category grants a special Netherite transformation.

If the player owns the ARMOR category:
- Diamond armor can become Netherite armor while equipped.
- Preserve enchantments.
- Preserve durability.
- Preserve trims.
- Preserve custom names.
- Preserve lore.
- Preserve all relevant item metadata.

If the player removes the armor:
- It returns to its original Diamond form.

The system must track the original item safely so no duplication or item loss occurs.

==================================================
SWORD
==================================================

PASSIVE:

Every 5 successful critical hits:
The player's next 5 critical hits deal 1.5x damage.

After those 5 empowered crits are consumed:
90-second cooldown begins.

ABILITY:

/strengthability

Create a 20-block-wide circular combat zone.

For 30 seconds, automatically perform sword slash attacks against enemy PLAYERS inside the zone.

Only players should be automatically attacked.

Do not attack the caster.

Cooldown: 120 seconds.

Use sweep particles, crit particles, sword swing sounds, and directional slash effects.

==================================================
AXE
==================================================

PASSIVE:

Every 7 critical hits trigger a special Mace-style impact.

The impact deals approximately the damage of a mace smash performed from 5 blocks high.

Cooldown: 10 seconds.

ABILITY:

Throw the player's axe.

Maximum throws: 3.

If it hits a player:
- Stun for 1.5 seconds.
- Immediately return the axe.

If it misses:
- Search within 30 blocks for a valid return condition.
- Return the axe to the player's inventory.
- Preserve remaining throws.

After 3 throws:
150-second cooldown.

Prevent item duplication.

==================================================
TRIDENT
==================================================

PASSIVE:

Every 5 critical hits creates a lightning strike.

No cooldown.

Lightning must visually and mechanically feel powerful but avoid unnecessary terrain destruction.

ABILITY:

Create a 3D cyan water-like box around the player.

Duration: 15 seconds.

Inside this area the player can use Riptide even when not in water or rain.

Create water, bubble, and electric particles.

Cooldown: 100 seconds.

==================================================
SHIELD
==================================================

PASSIVE:

After successfully blocking 10 attacks without having the shield disabled/broken by an axe:

Release a massive knockback pulse.

Approximately 10-block knockback.

Cooldown: 5 seconds.

ABILITY:

Create a protective bubble around the player.

Duration: 15 seconds.

While active:
- Block incoming attacks.
- Bounce arrows/projectiles.
- Prevent nearby players from entering.
- Protect from splash potion effects where technically possible.

Cooldown: 135 seconds.

Use shield block sounds, glass-like particles, and circular particles.

==================================================
ARMOR
==================================================

PASSIVE:

Diamond armor is treated as Netherite while equipped.

ABILITY:

/strengthability

Gain:
Resistance II
Slowness II

Duration: 30 seconds.

Cooldown: 120 seconds.

Use dark metallic particles around the player.

==================================================
MACE
==================================================

All Maces have a normal 60-second Smash cooldown.

Mace Strength category passive:
Reduce Smash cooldown from 60 seconds to 30 seconds.

ABILITY:

Gain Wind Burst II-style behavior and remove the normal mace smash cooldown for 20 seconds.

After 20 seconds:
250-second cooldown.

Use wind particles and strong impact sounds.

==================================================
CROSSBOW
==================================================

PASSIVE:

Every 5 successful shots that hit a player trigger a special shot.

The special shot has:
50% chance = Wither-Tipped Arrow effect
50% chance = Sonic Boom-style attack.

Sonic Boom has a 5-second cooldown.

ABILITY:

Charge 3 Sonic Boom attacks.

Once fully charged:
The player can release three Sonic Booms.

After all three are used:
200-second cooldown.

==================================================
BOW
==================================================

PASSIVE:

Every 5 successful hits:
The next 10 arrows gain strong homing/aim assistance.

After the 10 arrows:
10-second cooldown.

ABILITY:

Explosive Arrows.

3 charges.

Each arrow explodes on impact.

Do not destroy blocks by default.

After 3 shots:
75-second cooldown.

==================================================
SPEAR
==================================================

The Spear category applies to the server's supported spear weapon.

PASSIVE:

Spear attacks have approximately sword-like attack speed.

The Strength Spear cannot use the Lunge enchantment.

ABILITY:

Charge a Lunge.

Display a 0% β†’ 100% charging indicator.

At 100%, release the lunge.

Maximum travel:
15 blocks.

If a wall or solid block is encountered, stop immediately.

Create a powerful forward particle trail.

Cooldown: 120 seconds.

==================================================
TAB 3 β€” TRIMS SMP
==================================================

Create abilities for EVERY vanilla armor trim pattern.

Support these 18 trims:

SENTRY
DUNE
COAST
WILD
TIDE
WARD
VEX
RIB
SNOUT
EYE
SPIRE
SILENCE
WAYFINDER
RAISER
SHAPER
HOST
FLOW
BOLT

A player receives a Trim power when wearing a COMPLETE armor set with the SAME trim pattern.

The trim material does not matter unless configured otherwise.

If one armor piece is removed:
The Trim power becomes inactive.

Command:
/trimability

activates the player's Trim ability.

Every trim needs a completely unique ability.

Suggested powers:

SENTRY β€” FORTIFICATION
Create a defensive pulse giving Resistance briefly.

DUNE β€” SANDSTORM
Create a swirling sandstorm around the caster that blinds/slows enemies.

COAST β€” TIDAL BREATH
Create a water-like field granting Water Breathing and temporary aquatic mobility.

WILD β€” NATURE CALL
Summon temporary hostile-looking but harmless vine/root effects that trap enemies.

TIDE β€” OCEANIC CRUSH
Create a powerful water shockwave that pushes enemies away.

WARD β€” SCULK PULSE
Release a dark-blue sculk pulse that detects nearby players and damages enemies.

VEX β€” PHANTOM SWARM
Create temporary vex-like visual effects that attack nearby enemies.

RIB β€” WITHER BURST
Release a dark Nether shockwave applying a short Wither effect.

SNOUT β€” PIGLIN FURY
Create a golden Nether pulse giving temporary Strength and Resistance.

EYE β€” ENDER GATE
Teleport the player a short distance while creating Ender particles.

SPIRE β€” END REBOUND
Launch the player upward and give controlled slow falling.

SILENCE β€” SONIC BOOM
Fire a Warden-style sonic boom.

WAYFINDER β€” PATHFINDER
Reveal nearby players/entities through glowing outlines temporarily.

RAISER β€” EARTH RISE
Create a rising shockwave from the ground.

SHAPER β€” TERRAFORM
Create temporary protective terrain-like visual effects around the player without permanently griefing the world.

HOST β€” GUARDIAN HOST
Summon temporary protective visual entities/effects that attack nearby enemies.

FLOW β€” WIND FLOW
Create a swirling wind attack that launches enemies.

BOLT β€” LIGHTNING BOLT
Call down targeted lightning on the player's selected enemy.

Every Trim ability must have:
- Unique cooldown.
- Unique particles.
- Unique sounds.
- Unique activation animation.
- Clear GUI description.
- Anti-spam protection.
- Proper multiplayer targeting.
- No accidental self-damage unless explicitly intended.

==================================================
/DESCRIPTION GUI
==================================================

The command:

/description

opens the main encyclopedia.

It must contain three large buttons:

ANOMALIES
STRENGTH
TRIMS

Clicking ANOMALIES opens a second GUI containing all eight gems.

Each gem gets its own themed page showing:

NAME
ENERGY
ABILITY 1
ABILITY 2
COOLDOWNS
ENERGY COST
DESCRIPTION
PARTICLES
SOUNDS
SPECIAL RULES

Clicking STRENGTH opens the weapon-category encyclopedia.

Every category gets its own page explaining:
- Passive.
- Active ability.
- Cooldown.
- Requirements.
- Strength bonus.
- Special mechanics.

Clicking TRIMS opens every trim.

Every trim receives its own page.

The GUI should use color-coded icons:
Green for Wild.
Red for Ravager.
Yellow for Radiant.
White for Frost.
Pink for Heartbreak.
Orange for Inferno.
Purple for Void.
Cyan for Tidal.

==================================================
VFX / SOUND REQUIREMENTS
==================================================

Use vanilla Minecraft particles whenever possible.

Every ability must have at minimum:
1 activation effect
1 movement/projectile effect
1 impact effect
1 ending effect

Do not spam thousands of particles every tick.

Optimize particle counts.

Use sounds such as:
ENTITY_PLAYER_ATTACK_CRIT
ENTITY_PLAYER_ATTACK_SWEEP
ENTITY_GENERIC_EXPLODE
ENTITY_LIGHTNING_BOLT_THUNDER
ENTITY_WARDEN_SONIC_BOOM
BLOCK_AMETHYST_BLOCK_CHIME
BLOCK_BEACON_POWER_SELECT
ENTITY_ENDERMAN_TELEPORT
ENTITY_PLAYER_LEVELUP
BLOCK_GRASS_PLACE
BLOCK_SNOW_PLACE
ENTITY_GENERIC_DRINK
ITEM_SHIELD_BLOCK
ITEM_TRIDENT_THUNDER
ENTITY_WITHER_SHOOT
ENTITY_BREEZE_WIND_BURST

Use pitch variation so abilities do not sound identical.

==================================================
BALANCING
==================================================

Every ability must be configurable in config.yml.

Allow administrators to change:
- Damage.
- Duration.
- Cooldown.
- Energy cost.
- Radius.
- Range.
- Particle amount.
- Knockback.
- Effects.
- Strength multipliers.
- Regeneration speed.
- Maximum energy.

Create permissions:

anomalies.use
anomalies.admin
anomalies.gem
anomalies.strength
anomalies.trim
anomalies.reload

Admin commands should include:

/anomalyadmin give  
/anomalyadmin energy  
/anomalyadmin reset 
/anomalyadmin strength  
/anomalyadmin trim  
/anomalyadmin reload

==================================================
IMPORTANT TECHNICAL REQUIREMENTS
==================================================

Prevent duplication exploits.

Prevent cooldown bypasses.

Persist all player data.

If the server restarts, players retain:
- Gem.
- Energy.
- Strength category.
- Cooldowns where appropriate.
- Trim status.

Do not permanently modify vanilla armor/items when temporary transformations are being used.

Do not destroy player items.

Do not create permanent blocks for combat abilities unless explicitly configured.

Make all abilities safe for multiplayer servers.

Use asynchronous tasks only where appropriate and never access Bukkit API unsafely from asynchronous threads.

Provide clean code organization:

Anomalies/
    GemManager
    EnergyManager
    AbilityManager
    GemGUI
    GemTrader

Strength/
    StrengthManager
    WeaponManager
    SwordAbility
    AxeAbility
    TridentAbility
    ShieldAbility
    ArmorAbility
    MaceAbility
    CrossbowAbility
    BowAbility
    SpearAbility

Trims/
    TrimManager
    TrimAbilityManager
    Individual trim ability classes

GUI/
    DescriptionGUI
    GemGUI
    StrengthGUI
    TrimGUI

Commands/
    AbilityCommand
    StrengthAbilityCommand
    TrimAbilityCommand
    DescriptionCommand
    EnergyCommand
    RecipeCommand

Config/
    ConfigManager

Make the plugin feel like a complete polished SMP system rather than a collection of random commands.

The most important goal is that every system feels visually connected while still having its own identity.

The GEM system should feel mystical and supernatural.

The STRENGTH system should feel aggressive, competitive, and weapon-focused.

The TRIM system should feel ancient, mysterious, and artifact-like.

Use titles, subtitles, action bars, boss bars, particles, sounds, cooldown indicators, and GUI animations to make abilities feel powerful.

Do not simply execute vanilla commands whenever an ability is activated. Build the actual mechanics programmatically so the systems interact correctly with players, entities, projectiles, armor, weapons, cooldowns, energy, and multiplayer combat.

Finally, include extensive comments explaining the major systems and provide a complete README explaining installation, configuration, commands, permissions, crafting/obtaining gems, energy regeneration, Strength categories, Trim powers, and administrator controls.
Kodari AI
KodariOct 3 at 2:52 pm 3
AnomaliesSMP
A comprehensive SMP plugin with three main systems. The Anomalies system grants players one of eight mystical gems, each with two active abilities, an energy meter, cooldowns, and unique particle/sound effects. The Strength system randomly assigns a permanent weapon category (Sword, Axe, Trident, etc.) granting passive bonuses and a powerful active ability. The Trims system activates unique powers when wearing a complete armor set with a matching trim pattern. Includes a full GUI encyclopedia, configurable settings, persistent player data, admin commands, and an Anomaly Trader for gem exchange. All abilities use vanilla particles, sounds, and mechanics without requiring custom resource packs.
  1. Create the Paper/XSeries project skeleton, plugin metadata, defaults, and documentation.

  2. Implement saved player profiles, energy/cooldowns, gem and trim powers, and Strength categories.

  3. Add commands, trader/encyclopedia menus, and combat/event handling.

Created the ANOMALIES SMP Paper project with saved player profiles, energy and cooldowns, Anomaly and Trim powers, Strength categories, menus, commands, configuration, and a README. Use /ability 1 or /ability 2; Bukkit does not support the requested /ability:1 form as a normal plugin command.

This is a playable foundation, not a complete implementation of every detailed mechanic in the spec. In particular, the temporary diamond-to-netherite armor transformation, several charge-based weapon passives, projectile reflection, and the optional boss bar are not implemented.

neston_r.i.p_first_acc

make a new command being able to do /smp start every new player who joins and players who already are in will get this new tab where you can choose your destiny if pressing the gems it will roll a gem basically a echo shard it will give you one of does abilities if you choose strength you will get one weapon you need to get the weapon in your inventgory it wont give it to yout its like the real strength smp and for the trim you basically need a full set of a trim

Kodari AI
KodariOct 3 at 3:15 pm 1
  1. Inspect the command, inventory, and player-data patterns; then add /smp start with a persistent destiny-selection GUI and the described gem/strength/trim mechanics.

  • Persist each player’s one-time destiny and the SMP started state.

  • Add /smp start to open the chooser for online players and automatically prompt new joiners.

  • Add gem/strength/trim choices, requiring the matching strength item in inventory or a full matching trim set to use those powers.

Added /smp start for admins. It opens a one-time destiny chooser for online players, and new players are prompted after joining once the SMP has started. The started state and each player’s choice are saved.

  • Gem: rolls a random Anomaly and unlocks its abilities.

  • Strength: rolls a random discipline; you must find and carry its matching item yourself.

  • Trim: unlocks the trim ability, which requires wearing four armor pieces with the same trim.

Destiny selection requires anomalies.admin, which is op-only by default.

neston_r.i.p_first_acc

add a recipe doing /recipe to open the recfipe aka for gems reroller and the strength reroller and add a admin command /switch tab gem , strength, trims and add a recipe for a book to change your tab make the recipe slightly hard not to hard

Kodari AI
KodariOct 3 at 3:30 pm 2
  1. Add /recipe with a GUI for the gem and strength reroller recipes.

  2. Add admin /switch tab <gem|strength|trims>.

  3. Add a moderately difficult recipe for a book that lets players change their tab.

  1. /recipe now shows the gem and strength reroller recipes, plus the tab-change book recipe. Crafted rerollers change your current gem or strength category to a different random one.

  2. Added admin-only /switch tab <gem|strength|trims>, with an optional player name to switch someone else.

  3. The tab-change book uses Echo Shards, Amethyst Shards, Gold Ingots, and a Book. Right-click it to choose a new destiny tab.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
12 1,754
src/main/java/com/kodari/anomaliessmp/AnomaliesSmp.java
package com.kodari.anomaliessmp;

import com.kodari.anomaliessmp.command.RootCommand;
import com.kodari.anomaliessmp.gui.MenuManager;
import com.kodari.anomaliessmp.listener.PowerListener;
import com.kodari.anomaliessmp.power.PowerManager;
import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;

public final class AnomaliesSmp extends JavaPlugin {
    private ProfileStore profileStore;
    private PowerManager powerManager;
    private MenuManager menuManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        profileStore = new ProfileStore(this);
        powerManager = new PowerManager(this, profileStore);
        menuManager = new MenuManager(this, powerManager);
        PowerListener listener = new PowerListener(this, powerManager, menuManager);
        Bukkit.getPluginManager().registerEvents(listener, this);
        RootCommand rootCommand = new RootCommand(this, powerManager, menuManager);
        for (String name : new String[]{"anomalies", "gem", "ability", "ability1", "ability2", "energy", "strength", "strengthability", "trimability", "description", "recipe", "gemreload", "anomalyadmin", "smp", "switch"}) {
            getCommand(name).setExecutor(rootCommand);
            getCommand(name).setTabCompleter(rootCommand);
        }
        registerCoreRecipe();
        registerRerollerRecipes();
        registerTabChangeRecipe();
        powerManager.startTasks();
        getLogger().info("ANOMALIES SMP is ready.");
    }

    @Override
    public void onDisable() {
        if (profileStore != null) profileStore.save();
    }

    public void reloadPlugin() {
        reloadConfig();
    }

    private void registerCoreRecipe() {
        ItemStack core = powerManager.createCore();
        NamespacedKey key = new NamespacedKey(this, "anomaly_core");
        Bukkit.removeRecipe(key);
        ShapedRecipe recipe = new ShapedRecipe(key, core);
        recipe.shape("EAD", "ANA", "DAE");
        recipe.setIngredient('E', material("ECHO_SHARD"));
        recipe.setIngredient('A', material("AMETHYST_SHARD"));
        recipe.setIngredient('D', material("DIAMOND"));
        recipe.setIngredient('N', material("NETHER_STAR"));
        Bukkit.addRecipe(recipe);
    }

    private void registerRerollerRecipes() {
        NamespacedKey gemKey = new NamespacedKey(this, "gem_reroller");
        Bukkit.removeRecipe(gemKey);
        ShapedRecipe gemRecipe = new ShapedRecipe(gemKey, powerManager.createGemReroller());
        gemRecipe.shape("EAE", "ADA", "EAE");
        gemRecipe.setIngredient('E', material("ECHO_SHARD"));
        gemRecipe.setIngredient('A', material("AMETHYST_SHARD"));
        gemRecipe.setIngredient('D', material("DIAMOND"));
        Bukkit.addRecipe(gemRecipe);

        NamespacedKey strengthKey = new NamespacedKey(this, "strength_reroller");
        Bukkit.removeRecipe(strengthKey);
        ShapedRecipe strengthRecipe = new ShapedRecipe(strengthKey, powerManager.createStrengthReroller());
        strengthRecipe.shape("IGI", "BDB", "IGI");
        strengthRecipe.setIngredient('I', material("IRON_INGOT"));
        strengthRecipe.setIngredient('G', material("GOLD_INGOT"));
        strengthRecipe.setIngredient('B', material("BLAZE_POWDER"));
        strengthRecipe.setIngredient('D', material("DIAMOND"));
        Bukkit.addRecipe(strengthRecipe);
    }

    private void registerTabChangeRecipe() {
        NamespacedKey key = new NamespacedKey(this, "tab_change_book");
        Bukkit.removeRecipe(key);
        ShapedRecipe recipe = new ShapedRecipe(key, powerManager.createTabChangeBook());
        recipe.shape("EAE", "GBG", "EAE");
        recipe.setIngredient('E', material("ECHO_SHARD"));
        recipe.setIngredient('A', material("AMETHYST_SHARD"));
        recipe.setIngredient('G', material("GOLD_INGOT"));
        recipe.setIngredient('B', material("BOOK"));
        Bukkit.addRecipe(recipe);
    }

    private org.bukkit.Material material(String name) {
        return XMaterial.matchXMaterial(name).map(XMaterial::parseMaterial).orElseThrow();
    }
}