khadija bouk

make me a mod wwhere you are an obese man and you need to eat healthy food and sprint etc to loose weight and when you reach 80kg they give you strenght and a goku op powers

Kodari AI
KodariWed at 9:19 am 1
WeightWarrior
A Minecraft plugin that turns weight management into a gameplay mechanic. Players start as an obese character and must eat healthy foods, sprint, and exercise to lose weight. The plugin tracks weight in real-time, rewarding progress with strength enhancements. Upon reaching 80kg, players unlock Goku-inspired overpowered abilities including flight, energy blasts, and super strength. Unhealthy foods increase weight, creating a risk-reward system. Features include configurable weight thresholds, visual feedback, and progression-based power scaling.

I’ll build this as a survival progression plugin: start overweight, lose weight by eating healthy foods and sprinting, and unlock Strength and a powerful energy blast at 80 kg.

Created the weight-loss progression plugin. Use /weight to check your progress and /blast after reaching 80 kg.

Weight loss, foods, Strength, and blast settings are configurable. The plugin doesn’t change the player’s appearance.

Kodari can make mistakes. Review important code before using.
Files
src
Code
3 170
src/main/java/com/kodari/weightjourney/WeightJourney.java
package com.kodari.weightjourney;

import com.cryptomorin.xseries.XPotion;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Fireball;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public final class WeightJourney extends JavaPlugin implements Listener {
    private final Map<UUID, Double> weights = new HashMap<>();
    private final Map<UUID, Long> blastCooldowns = new HashMap<>();
    private File dataFile;
    private YamlConfiguration data;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        dataFile = new File(getDataFolder(), "weights.yml");
        data = YamlConfiguration.loadConfiguration(dataFile);
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("weight").setExecutor((sender, command, label, args) -> {
            if (!(sender instanceof Player)) {
                sender.sendMessage("Only players have a weight.");
                return true;
            }
            Player player = (Player) sender;
            player.sendMessage(color("&eWeight: &f" + format(weight(player)) + " kg &7| Goal: &f" + format(goal()) + " kg"));
            player.sendMessage(color(unlocked(player) ? "&6Your powers are unlocked! Use /blast." : "&7Eat healthy food and sprint to lose weight."));
            return true;
        });
        getCommand("blast").setExecutor((sender, command, label, args) -> {
            if (!(sender instanceof Player)) {
                sender.sendMessage("Only players can use this power.");
                return true;
            }
            Player player = (Player) sender;
            if (!unlocked(player)) {
                player.sendMessage(color("&cReach " + format(goal()) + " kg to unlock this power."));
                return true;
            }
            long now = System.currentTimeMillis();
            long remaining = blastCooldowns.getOrDefault(player.getUniqueId(), 0L) - now;
            if (remaining > 0) {
                player.sendMessage(color("&cEnergy blast recharges in " + ((remaining + 999) / 1000) + " seconds."));
                return true;
            }
            Fireball fireball = player.launchProjectile(Fireball.class);
            fireball.setYield((float) Math.max(0, getConfig().getDouble("blast.explosion-power", 3.0)));
            fireball.setIsIncendiary(false);
            blastCooldowns.put(player.getUniqueId(), now + Math.max(0L, getConfig().getLong("blast.cooldown-seconds", 30)) * 1000L);
            player.sendMessage(color("&6Energy blast!"));
            return true;
        });
        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player player : getServer().getOnlinePlayers()) {
                if (player.isSprinting() && !player.isInsideVehicle() && !player.isFlying()) {
                    changeWeight(player, -Math.max(0, getConfig().getDouble("sprint-loss-per-second", 0.02)));
                }
                if (unlocked(player)) {
                    XPotion.matchXPotion("STRENGTH")
                            .map(potion -> potion.buildPotionEffect(60, Math.max(0, getConfig().getInt("strength-amplifier", 1))))
                            .ifPresent(effect -> applyStrength(player, effect));
                }
            }
        }, 20L, 20L);
        getServer().getScheduler().runTaskTimer(this, this::saveWeights, 6000L, 6000L);
    }

    @EventHandler(ignoreCancelled = true)
    public void onConsume(PlayerItemConsumeEvent event) {
        String food = event.getItem().getType().name();
        if (getConfig().getStringList("healthy-foods").stream().anyMatch(name -> name.equalsIgnoreCase(food))) {
            Player player = event.getPlayer();
            changeWeight(player, -Math.max(0, getConfig().getDouble("healthy-food-loss", 0.25)));
            player.sendMessage(color("&aHealthy meal! &7Weight: &f" + format(weight(player)) + " kg"));
        }
    }

    private void applyStrength(Player player, PotionEffect effect) {
        PotionEffect current = player.getPotionEffect(effect.getType());
        if (current == null || current.getAmplifier() <= effect.getAmplifier()) {
            player.addPotionEffect(effect);
        }
    }

    private double weight(Player player) {
        return weights.computeIfAbsent(player.getUniqueId(), id -> data.getDouble(id.toString(), getConfig().getDouble("starting-weight", 150.0)));
    }

    private void changeWeight(Player player, double change) {
        double before = weight(player);
        double after = Math.max(goal(), before + change);
        weights.put(player.getUniqueId(), after);
        if (before > goal() && after <= goal()) {
            player.sendMessage(color("&6&lYou reached your goal! &eStrength and /blast unlocked!"));
        }
    }

    private boolean unlocked(Player player) {
        return weight(player) <= goal();
    }

    private double goal() {
        return Math.max(1.0, getConfig().getDouble("goal-weight", 80.0));
    }

    private String format(double value) {
        return String.format(Locale.ROOT, "%.1f", value);
    }

    private String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

    private void saveWeights() {
        weights.forEach((id, value) -> data.set(id.toString(), value));
        try {
            data.save(dataFile);
        } catch (IOException exception) {
            getLogger().warning("Could not save weights: " + exception.getMessage());
        }
    }

    @Override
    public void onDisable() {
        if (data != null) saveWeights();
    }
}