tomothi

Hi Kodari, can i have a 1.21.4 paper plugin that does the following

  • When hovering over someone's name it gives you a snippet into their player info such as name, rank, playtime and when you click on someone's name you can send em a message by clicking thheir name
  • when you do [item] it shows the item in your hand currently
Kodari AI
KodariJan 20 at 10:36 am 5,757 (v2)

I’ll create an interactive chat enhancement plugin for Paper 1.21.4 with player info tooltips and item display functionality.

InteractiveChatPlugin
Enhances chat interactions with hoverable player names showing rank and playtime information, clickable player mentions for direct messaging, and item display using [item] placeholder. Built for Paper 1.21.4 using Adventure API for rich text components and interactive chat elements.

Done! Created InteractiveChatPlugin for Paper 1.21.4 with:

Features:

  • @PlayerName mentions: Hover shows name/rank/playtime, click suggests /msg PlayerName

  • [item] placeholder: Displays your held item with full hover preview

  • Automatic playtime tracking: Updates every second for online players

  • Persistent data: Stores player ranks and playtime in playerdata.yml

Usage:

  • Type @Notch in chat → Creates hoverable/clickable mention

  • Type Hello [item] while holding diamond → Shows item in chat

  • Player data auto-saves on shutdown

The plugin uses Paper’s Adventure API for rich text components and interactive chat elements. Playtime is tracked in seconds and formatted as hours/minutes.

tomothi

i have playerstats which records playtime, can it be linked to that

Kodari AI
KodariJan 20 at 10:51 am 7,799 (v2)

I’ll check your current plugin structure to see how we can integrate with a playtime stats plugin.

Yes! I can integrate with PlayerStats to pull playtime data instead of tracking it internally. I’ll create a hook system that:

  • Detects if PlayerStats is installed

  • Pulls playtime from PlayerStats API if available

  • Falls back to internal tracking if not

Done! The plugin now:

  • Automatically detects PlayerStats on startup

  • Uses PlayerStats API for playtime if available

  • Falls back to internal tracking if PlayerStats isn’t installed

  • Displays the correct playtime in player mention tooltips

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
8 415
src/main/java/com/interactivechat/InteractiveChatPlugin.java
package com.interactivechat;

import com.interactivechat.hook.PlayerStatsHook;
import com.interactivechat.listener.ChatListener;
import com.interactivechat.manager.PlayerDataManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class InteractiveChatPlugin extends JavaPlugin {
    
    @Getter
    private static InteractiveChatPlugin instance;
    
    @Getter
    private PlayerDataManager playerDataManager;
    
    @Getter
    private PlayerStatsHook playerStatsHook;
    
    @Override
    public void onEnable() {
        instance = this;
        
        saveDefaultConfig();
        
        playerStatsHook = new PlayerStatsHook();
        if (playerStatsHook.isEnabled()) {
            getLogger().info("Hooked into PlayerStats for playtime tracking!");
        } else {
            getLogger().info("PlayerStats not found, using internal playtime tracking");
        }
        
        playerDataManager = new PlayerDataManager(this);
        playerDataManager.load();
        
        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        
        getLogger().info("InteractiveChatPlugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.save();
        }
        
        getLogger().info("InteractiveChatPlugin has been disabled!");
    }
}