public class Coins {
@SubscribeEvent
public void xd(ClientChatReceivedEvent event) {
String message = event.message.getUnformattedText();
//message is the message which the client receives.
if(message.startsWith("+") && message.contains("coins") && !message.endsWith("for being generous")) {
//Checks if the coin message you got isn't the tip message
String[] splittedMessage = message.split("coins");
message = splittedMessage[0].replace("+", "");
message = message.replace(" ", "");
int coins = Integer.parseInt(message);
int totalCoins = 0;
totalCoins = totalCoins + coins;
}
}
@SubscribeEvent
public void render(RenderGameOverlayEvent event) {
if (event.isCancelable() || event.type != ElementType.EXPERIENCE) {
return;
}
FontRenderer fRender = Minecraft.getMinecraft().fontRendererObj;
fRender.drawString(EnumChatFormatting.GREEN + "Coins: " + EnumChatFormatting.WHITE + totalCoins, 5, 5, 0);
}
}
totalCoins = totalCoins + coins;
totalCoins cannot be resolved to a variable
fRender.drawString(EnumChatFormatting.GREEN + "Coins: " + EnumChatFormatting.WHITE + totalCoins, 5, 5, 0);
totalCoins cannot be resolved to a variable