Jump to content

Erol

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Erol

  1. Thanks, but I can't seem to escape from it if I use java robot and do r.mousePress(KeyEvent.ESCAPE);. Any suggestions on how I could escape from the guiIngameMenu without the use of robot?
  2. I have been searching but I can't seem to find any command that would check if the player(that is using this forge mod) is in the main menu(menu that shows up if you press escape button). Any suggestions? Thanks!
  3. Good evening! I tried to implement scheduled(delayed) tasks in my code and now every few seconds I get this message in terminal. I am using eclipse. The scheduled task seems to work fine I am just scared that this mod won't make too much for people using it. If anyone could figure out Initializing(if this is correct term) the timer: private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); The delayed function: void DelayedTask() { //flag=false; System.out.println("CHECK1"); if(DntbMod.DoQuests) { m.thePlayer.sendChatMessage(GetGame()); } else{m.thePlayer.sendChatMessage(DntbMod.komanda);} } Calling the delayed function: sleep= 3000+(long)(Math.random()*5000); scheduler.schedule(new Runnable() {public void run() { DelayedTask(); }}, sleep, MILLISECONDS); Thank you for your help. Erol
  4. To just add chat messages, type this: EntityPlayer.addChatMessage(new ChatComponentText("Hello World!")) Eclipse responds with: Cannot make a static reference to the non-static method addChatMessage(IChatComponent) from the type Entity Anyone knows what that means/how to avoid it?
  5. Hello! I was wondering how can you send a chat message, for example how can a mod type Hello(in chat you will see this as "Your_Nickname: Hello"). I already tried few things like Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Hello")); but that just ends up showing the message to the client, which is not what i need. I tried player.addChatMessage(newChatComponentText("Hello")); but eclipse tells me that player can not be resolved, my friend also mentioned I needed to use EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; which would tell me the player nickname, but this doesn't work. Anyone knows how do I do it? Thank you in advance, Erol
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.