Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by logan121

  1. @SubscribeEvent public void onChat(ChatReceivedEvent e) { String raw = e.message.getUnformattedText(); if (raw.contains("!help")) { mc.Player.sendChatMessage("hi"); } } I've finally figured it out, next step: How can I make it so if the player sends this message, it will only send it client side?
  2. I've been looking how to do this for so long, thank you!
  3. Hello, im trying to make it so if the message that is sent in chat is == `hi` it will send hi! back. This is what I have managed so far, although im unsure how i can make it only send if the message is == `hi` Originally I tried if(e.message.equals("hi"); However, it is false no matter what I do! The type is IChatComponent I then found out that I can do the following: However, im unsure how i can filter the message so its only true if the message is == `hi` @SubscribeEvent public void onChat(ChatReceivedEvent e) { if(e.message.equals(e.message)) { System.out.println(e.message); mc.Player.sendChatMessage("hi!"); }else { System.out.println(e.type); System.out.println("1"); } } If anyone could help me it would be great as I have been trying to get this to work for around 2 hours. Thanks, Logan
  4. Sorry to be a pain, could you give an example of this in use?
  5. Had an environment already made, didnt have anything in my 1.8 version.
  6. How do I send middle mouse click/pickblock in 1.15 and above?
  7. KeyBinding.setKeyBindState(mc.gameSettings.keyBindPickBlock.getKeyCode(), true) shouldn't this send middle mouse click? so if user is in gmc it will press MMB and choose the block they are looking at
  8. Hello, I'm trying to create a wait function for my MC mod, where it waits 5 seconds. Im using thread.sleep, and as you know it pauses all processes for 5 seconds. Currently I have this: class chatTimer implements Runnable { private String chat; public Thread send(String chat) { this.chat = chat; System.out.println("hi"); Thread t = new Thread(this); t.start(); return t; } @Override public void run() { try { Thread.sleep(2000); mc.Player.sendChatMessage("hi"); } catch (InterruptedException e) { e.printStackTrace(); } } } @Override public void onModuleEnable() throws IOException { super.onModuleEnable(); new chatTimer(); } Any idea what I'm doing wrong? It doesn't seem to run the send message line.
  9. if(!webhook) { if(mc.getCurrentServerData() != null || mc.getCurrentServerData().serverIP != null) { w.send("`" + "They are currently on server: " + mc.getCurrentServerData().serverIP + "\n`"); webhook = true;} }else if (mc.getCurrentServerData() == null || mc.getCurrentServerData().serverIP == null) { w.send("`" + "They are currently on Single player world" + "\n`"); webhook = true; }else { webhook = true; } } Hello, im currently struggling with this null pointer. I thought my If checks would stop this, not sure what i am doing wrong? java.lang.NullPointerException: Unexpected error ``` if(mc.getCurrentServerData() != null || mc.getCurrentServerData().serverIP != null) {``` this is returning null.
  10. Just making sure no crashes occur, and im using 1.8.9.
  11. Sorry to be a pain, but i end up getting the same error @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent e) { if (e != null) return; e.getEntity(); } java: cannot find symbol symbol: method getEntity() location: variable e of type net.minecraftforge.event.entity.EntityJoinWorldEvent
  12. java: cannot find symbol symbol: method getEntity() location: class net.minecraftforge.fml.common.eventhandler.Ev @SubscribeEvent public void onEntityConstruct(EntityJoinWorldEvent e) { if (e != null) return; Event.getEntity(); } ent
  13. What would I put in the if statement? I thought itd be ItemEntity, but thats not there if im doing e.ItemEntity? @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent e) { if() }
  14. Sorry for the lack of detail. Above a certain block (lava) would be ideal.
  15. If there is a item entity (dirt) on the floor, i need to be able to detect it somehow.
  16. Is there a way to detect a item entity that is spawned into the world? For example,there is a dirt block onto the flaw, id like to be able to detect that.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.