ClipboardCoords icon

ClipboardCoords -----

Copy your Coordinates in literally any format.



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 ;
}
Resource Information
Author:
----------
Total Downloads: 55
First Release: Oct 8, 2022
Last Update: Oct 8, 2022
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings