Home›Java›Mods›ClipboardCoords
ClipboardCoords
ModsJava

ClipboardCoords

Java mod listed for Minecraft 1.19. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
Do you often find you need to copy coordinates many times, in various formats? This plugin will help you. That's it.

It's already been done, you say? The alternatives don't let you specify your own format, or they require you to Ctrl+A + Ctrl+C from chat. ClipboardCoords will let you specify any format you could possibly desire, and copy it to your clipboard with a single click.

It's simple. You could probably code it yourself in five minutes. But I did, so you don't have to!

Just type /coords to get started.

[​IMG]


Oh, you want to do it yourself? Sure!

Code (Java):
if (cmd. getName ( ). equalsIgnoreCase ( "coords" ) ) {
    if (sender instanceof Player ) {
        Player player = (Player ) sender ;
        if (args. length >= 1 ) {
            Location location = player. getLocation ( ) ;
            String format = String. join ( " ", args ) ;
            String result = format. replace ( "%x", String. valueOf (location. getBlockX ( ) ) )
                    . replace ( "%y", String. valueOf (location. getBlockY ( ) ) )
                    . replace ( "%z", String. valueOf (location. getBlockZ ( ) ) )
                    . replace ( "%X", String. valueOf (location. getX ( ) ) )
                    . replace ( "%Y", String. valueOf (location. getY ( ) ) )
                    . replace ( "%Z", String. valueOf (location. getZ ( ) ) )
                    . replace ( "%p", String. valueOf (location. getPitch ( ) ) )
                    . replace ( "%y", String. valueOf (location. getYaw ( ) ) )
                    . replace ( "%P", String. valueOf ( Math. round (location. getPitch ( ) ) ) )
                    . replace ( "%Y", String. valueOf ( Math. round (location. getYaw ( ) ) ) ) ;
            ClickEvent clickEvent = ClickEvent. copyToClipboard (result ) ;
            Component component = Component. text (ChatColor. DARK_AQUA + "Click to copy: " +
                            ChatColor. AQUA + result )
                    . hoverEvent ( Component. text ( "Click to copy!" ) )
                    . clickEvent (clickEvent ) ;
            player. sendMessage (component ) ;
        }
    }
    else {
        sender. sendMessage ( "You must be a player to use this command." ) ;
    }
    return true ;
}

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

ClipboardCoords is a free Minecraft Java mod. Compatible with Minecraft 1.19. Downloaded 61 times (via Spigot). Download it and open it directly in the game.

Explore more