Posted March 25, 20178 yr How can I detect using an event when a command gets triggered by the player (Clientside Only). I've looked through the list of events available in forge and can't find such an event.
March 25, 20178 yr You can listen for CommandEvent, which gets called whenever a command is about to be executed. There is no event atm that gets called after a command is executed, at least I don't think. If there is, I couldn't find it.
March 25, 20178 yr 8 minutes ago, SecondAmendment said: So no way of checking if a command gets sent client side If you mean "executed by the player", you can just check if the ICommandSender is an instanceof EntityPlayerMP using CommandEvent#getSender. If you actually mean client-side, check if it was sent by EntityPlayerSP. However, basically every single vanilla command is sent from the server (hence the EntityPlayerMP). The only exception is when chat messages are sent from a GUI. Edited March 25, 20178 yr by TheMasterGabriel
March 25, 20178 yr Author So lets say i go on a server and lets say that I made a command called /modinfo and I want it to present information as a result to the client on a server that doesnt use the mod. Would it work? Edited March 25, 20178 yr by SecondAmendment
March 25, 20178 yr If you are making a client-side only mod, register your commands with ClientCommandHandler instead of the typical way. All those commands are client-side and are sent from EntityPlayerSP.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.