
logan121
Members-
Posts
26 -
Joined
-
Last visited
Everything posted by logan121
-
@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?
-
I've been looking how to do this for so long, thank you!
-
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
-
How to send middle mouse click/pickblock in 1.15 and above?
logan121 replied to logan121's topic in Modder Support
Ohh i see, thanks! -
How to send middle mouse click/pickblock in 1.15 and above?
logan121 replied to logan121's topic in Modder Support
I don't know how to call something with a # in it no -
How to send middle mouse click/pickblock in 1.15 and above?
logan121 replied to logan121's topic in Modder Support
Sorry to be a pain, could you give an example of this in use? -
How to send middle mouse click/pickblock in 1.15 and above?
logan121 replied to logan121's topic in Modder Support
Had an environment already made, didnt have anything in my 1.8 version. -
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
-
Thanks!
-
How can I record player commands?
-
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.
-
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.
-
Just making sure no crashes occur, and im using 1.8.9.
-
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
-
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
-
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() }
-
It doesn't burn unfortunetly.
-
Sorry for the lack of detail. Above a certain block (lava) would be ideal.
-
If there is a item entity (dirt) on the floor, i need to be able to detect it somehow.
-
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.