Surya Gautam

create a nano tech suit that is every iron man and war machine suit combined with the power of all six infinity stones

Kodari AI
KodariNov 3 at 3:02 am 1
NanoInfinitySuit
A Minecraft plugin that grants players a fully customizable nano-tech suit combining Iron Man and War Machine capabilities with all six Infinity Stones. Features include flight with boosters, repulsor blasts, shoulder cannons, missile launchers, and energy shields. Infinity Stone powers provide time manipulation, reality alteration, space teleportation, soul detection, mind control, and power amplification. Suit activation via item or command, with configurable energy consumption, particle effects, cooldowns, and upgradeable armor tiers. Players can toggle individual components, cycle through weapon modes, and experience immersive HUD displays showing suit integrity and stone charge levels.

The suit will use vanilla armor and provide six stone abilities through /nanosuit, plus passive protection while the full set is worn.

Created a nano suit plugin with passive armor buffs and six Infinity Stone abilities.

Use /nanosuit equip to equip it, then /nanosuit to see the abilities. Each stone has a 15-second cooldown. The nanosuit.use permission defaults to operators.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
infinity suit
settings.gradle
Code
5 218
src/main/java/com/kodari/nanosuit/NanoSuitPlugin.java
package com.kodari.nanosuit;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public final class NanoSuitPlugin extends JavaPlugin {
    private NamespacedKey suitKey;
    private final Map<UUID, Map<String, Long>> cooldowns = new HashMap<>();

    @Override
    public void onEnable() {
        suitKey = new NamespacedKey(this, "nano_suit_piece");
        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player player : getServer().getOnlinePlayers()) {
                if (wearingSuit(player)) {
                    effect(player, "DAMAGE_RESISTANCE", 80, 1);
                    effect(player, "FIRE_RESISTANCE", 80, 0);
                    effect(player, "SPEED", 80, 1);
                    effect(player, "INCREASE_DAMAGE", 80, 0);
                }
            }
        }, 1L, 60L);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can use the nano suit.");
            return true;
        }
        Player player = (Player) sender;
        if (args.length != 1) {
            player.sendMessage(ChatColor.GOLD + "/nanosuit <equip|space|mind|reality|power|time|soul>");
            return true;
        }
        String ability = args[0].toLowerCase(Locale.ROOT);
        if (ability.equals("equip")) {
            equip(player);
            return true;
        }
        if (!Arrays.asList("space", "mind", "reality", "power", "time", "soul").contains(ability)) {
            player.sendMessage(ChatColor.RED + "Unknown ability. Use /nanosuit for the list.");
            return true;
        }
        if (!wearingSuit(player)) {
            player.sendMessage(ChatColor.RED + "Wear the complete nano suit to use the stones.");
            return true;
        }
        Map<String, Long> playerCooldowns = cooldowns.computeIfAbsent(player.getUniqueId(), ignored -> new HashMap<>());
        long now = System.currentTimeMillis();
        long remaining = playerCooldowns.getOrDefault(ability, 0L) - now;
        if (remaining > 0) {
            player.sendMessage(ChatColor.RED + "That stone recharges in " + ((remaining + 999) / 1000) + " seconds.");
            return true;
        }
        if (useAbility(player, ability)) {
            playerCooldowns.put(ability, now + 15000L);
            player.sendMessage(ChatColor.AQUA + "Infinity Stone activated: " + ability);
        }
        return true;
    }

    private void equip(Player player) {
        PlayerInventory inventory = player.getInventory();
        if (inventory.getHelmet() != null || inventory.getChestplate() != null
                || inventory.getLeggings() != null || inventory.getBoots() != null) {
            player.sendMessage(ChatColor.RED + "Empty all four armor slots first.");
            return;
        }
        ItemStack helmet = piece("NETHERITE_HELMET", "helmet");
        ItemStack chestplate = piece("NETHERITE_CHESTPLATE", "chestplate");
        ItemStack leggings = piece("NETHERITE_LEGGINGS", "leggings");
        ItemStack boots = piece("NETHERITE_BOOTS", "boots");
        if (helmet == null || chestplate == null || leggings == null || boots == null) {
            player.sendMessage(ChatColor.RED + "The suit materials are not available on this server.");
            return;
        }
        inventory.setHelmet(helmet);
        inventory.setChestplate(chestplate);
        inventory.setLeggings(leggings);
        inventory.setBoots(boots);
        player.sendMessage(ChatColor.GOLD + "Nano suit deployed. Use /nanosuit to see your stone abilities.");
    }

    private ItemStack piece(String material, String slot) {
        ItemStack item = XMaterial.matchXMaterial(material).map(XMaterial::parseItem).orElse(null);
        if (item == null) return null;
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(ChatColor.GOLD + "Nano Suit " + Character.toUpperCase(slot.charAt(0)) + slot.substring(1));
        meta.setUnbreakable(true);
        meta.getPersistentDataContainer().set(suitKey, PersistentDataType.STRING, slot);
        item.setItemMeta(meta);
        return item;
    }

    private boolean wearingSuit(Player player) {
        PlayerInventory inventory = player.getInventory();
        return isPiece(inventory.getHelmet(), "helmet") && isPiece(inventory.getChestplate(), "chestplate")
                && isPiece(inventory.getLeggings(), "leggings") && isPiece(inventory.getBoots(), "boots");
    }

    private boolean isPiece(ItemStack item, String slot) {
        if (item == null || !item.hasItemMeta()) return false;
        String stored = item.getItemMeta().getPersistentDataContainer().get(suitKey, PersistentDataType.STRING);
        return slot.equals(stored);
    }

    private boolean useAbility(Player player, String ability) {
        switch (ability) {
            case "space":
                Block target = player.getTargetBlockExact(30);
                if (target == null || !target.getRelative(0, 1, 0).isPassable()
                        || !target.getRelative(0, 2, 0).isPassable()) {
                    player.sendMessage(ChatColor.RED + "Look at a nearby block with two clear spaces above it.");
                    return false;
                }
                Location destination = target.getLocation().add(0.5, 1, 0.5);
                destination.setYaw(player.getLocation().getYaw());
                destination.setPitch(player.getLocation().getPitch());
                return player.teleport(destination);
            case "mind":
                for (Entity entity : player.getNearbyEntities(8, 8, 8)) {
                    if (entity instanceof LivingEntity) {
                        effect((LivingEntity) entity, "CONFUSION", 160, 0);
                        effect((LivingEntity) entity, "BLINDNESS", 100, 0);
                    }
                }
                return true;
            case "reality":
                effect(player, "INVISIBILITY", 200, 0);
                effect(player, "DAMAGE_RESISTANCE", 200, 3);
                return true;
            case "power":
                for (Entity entity : player.getNearbyEntities(6, 6, 6)) {
                    if (entity instanceof LivingEntity) {
                        ((LivingEntity) entity).damage(12.0, player);
                    }
                }
                return true;
            case "time":
                for (Entity entity : player.getNearbyEntities(8, 8, 8)) {
                    if (entity instanceof LivingEntity) {
                        effect((LivingEntity) entity, "SLOW", 160, 4);
                        effect((LivingEntity) entity, "SLOW_DIGGING", 160, 2);
                    }
                }
                return true;
            case "soul":
                effect(player, "REGENERATION", 160, 2);
                effect(player, "ABSORPTION", 200, 2);
                return true;
            default:
                return false;
        }
    }

    private void effect(LivingEntity entity, String name, int duration, int amplifier) {
        XPotion.matchXPotion(name)
                .map(potion -> potion.buildPotionEffect(duration, amplifier))
                .ifPresent(entity::addPotionEffect);
    }
}