mandarynka3d
📎 1 file 1,185 chars
📄
pasted-code-1768727565226.txt
txt 1 lines
▶
Create a Minecraft Spigot/Paper plugin (1.16+) in Java. The plugin adds a player temperature system. Each player has a temperature value in degrees Celsius, starting at 20°C when joining the server. When a player is standing in direct sunlight (sky visible above the player, no blocks), the temperature should gradually increase. When a player is inside a cave (block above the head) or inside water, the temperature should gradually decrease. If the player’s temperature goes above 45°C, the player should start burning and receive fire damage. When the temperature drops back below 45°C, the player must immediately stop burning. The current temperature must be constantly displayed to the player using ActionBar or BossBar with Polish text, for example: "Temperatura: 32°C". If a player dies because of fire or overheating, the plugin must execute a console command to ban the player with the reason "Zginales". Additionally, when a player with operator permissions joins the server, a chat message in Polish should be sent only to that player saying: "Dziekujemy za uzywanie naszego pluginu". The plugin should be fully functional, optimized, and ready to compile into a .jar file.
Kodari AI
KodariJan 18 at 9:13 am 6,164 (v2)

I’ll create a comprehensive temperature system plugin with Polish localization.

TemperatureSystem
A survival plugin that adds realistic temperature mechanics where players must manage their body temperature. Players start at 20°C and their temperature changes based on environment - increasing in direct sunlight and decreasing in caves or water. Exceeding 45°C causes fire damage and potential death. Features BossBar display and administrative console commands for player management.

Plan:

  • Build configuration with Spigot API and Lombok

  • Temperature data manager with player UUID tracking

  • Periodic task to check environment and adjust temperatures

  • BossBar display for real-time temperature feedback

  • Event handlers for join, death, and fire damage tracking

  • Console command execution on overheating death

Plugin Created Successfully!

The temperature system features:

  • Starting temperature: 20°C on join

  • Environmental effects: Sunlight increases temp (+0.3°C/s), caves/water decrease it (-0.2/-0.5°C/s)

  • Color-coded BossBar: Green (normal) → Yellow (warm) → Red (dangerous 45°C+)

  • Fire damage: Automatically ignites players above 45°C, extinguishes immediately when dropping below

  • Death punishment: Console executes ban command with “Zginales” reason for overheating deaths

  • OP welcome: Polish message “Dziekujemy za uzywanie naszego pluginu” on join

  • Optimized: Single 1-second task handles all players efficiently

Build with gradle build - the JAR will be in build/libs/.

mandarynka3d

Please Convert to jar

Kodari AI
KodariJan 18 at 9:15 am 2,278 (v2)

I’ll check the current build configuration to set up JAR generation properly.

Your project is ready to build! To generate the JAR file, run:

Shell
./gradlew build

Or on Windows:

Shell
gradlew.bat build

The compiled JAR will be located at:

Plain Text
build/libs/TemperaturePlugin-1.0.0.jar

The build.gradle is already properly configured with:

  • Java 8 compatibility

  • Spigot API as compileOnly dependency

  • Lombok support

  • XSeries included via manifest.kod

Just execute the gradle build command and your plugin JAR will be generated!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
9 357
src/main/java/pl/temperature/TemperaturePlugin.java
package pl.temperature;

import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import pl.temperature.listener.PlayerConnectionListener;
import pl.temperature.listener.PlayerDeathListener;
import pl.temperature.manager.TemperatureManager;
import pl.temperature.task.TemperatureUpdateTask;

public class TemperaturePlugin extends JavaPlugin {
    
    @Getter
    private TemperatureManager temperatureManager;
    
    @Override
    public void onEnable() {
        this.temperatureManager = new TemperatureManager(this);
        
        Bukkit.getPluginManager().registerEvents(new PlayerConnectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        
        new TemperatureUpdateTask(this).runTaskTimer(this, 20L, 20L);
        
        getLogger().info("TemperatureSystem plugin został włączony!");
    }
    
    @Override
    public void onDisable() {
        if (temperatureManager != null) {
            temperatureManager.clearAll();
        }
        getLogger().info("TemperatureSystem plugin został wyłączony!");
    }
}