2
\$\begingroup\$

I'm currently working on a Minecraft mod (Minecraft 1.12.2) using Minecraft Forge where the player can use a hotkey to send out a "SOS" message in a discord-server using a discord-bot. This SOS-message could contain things like the current coordinates of the player, the time of day, etc.

Now, I'm a total newbie on this topic and when trying to implement this mod I'm struggling to get certain information about the player (in this case the current coordinates). I assume this can be accessed through a certain class (not sure whether this is true or not), but when searching the web most search-results tell you how to see your current coordinates in game (which is not what I want: I want to be able to take these coordinates and send them to a discord-bot for example).

Anyone who has experience on this topic and could help me?

Just for information: tha name of the mod is "KDPVP" and my current program is written in the "KdPvp.java" file inside the package "com.cy4.kdpvp" inside the src/main/java folder of my project.

The current code in "KdPvp.java":

package com.cy4.kdpvp;

import net.minecraftforge.fml.common.Mod;

@Mod(modid = KdPvp.MODID, name = KdPvp.NAME, version = KdPvp.VERSION)
public class KdPvp
{
    public static final String MODID = "kdpvp";
    public static final String NAME = "KDPVP";
    public static final String VERSION = "1.0";
    
    public void sendSos()
    {
        // TODO take the current coordinates and send them to the discord bot
    }
}
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Found this from - Here

int playerCord = entityPlayer.getPlayerCoordinates()
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .