How would you make a custom command in your (client only) mod?
I was thinking about having a list with all your commands in it and a ClientChatEvent that checks of the message is one of the commands from the list. If so it cancels the normal command and runs your commands code otherwise it just runs whatever you typed.
but how do I add tab completion to that?
When using the PlayerEvent it triggers when ever any user joins the server (open the world to lan and join with second minecraft) and Minecraft#player is still null in the event for some reason
also PlayerEvent doesn't get called when joining a server (opening the other minecrafts lan)
all I need is the mc name + uuid in either when joining a server or in the home screen of minecraft.
but I cant seem to get the events to trigger when joining a server and Minecraft#player is always null
Im sorry I ment the Minecraft#getInstance#player
the player is still null when I tried calling it in the fmlSetupClientEvent
I wanna check there username and uuid for when they start the mod
but since I coudn't get the player in the FMLClientSetupEvent I tried on a server/world join but can't get that to work either.
Hey, I am trying to get a event triggered on whenever the user joins a server.
nothing I've tried seem to be working though
I have tried the EntityJoinWorldEvent but that crashes my game if I join singleplayer.
PlayerEvent.PlayerLoggedInEvent only works on singleplayer and also triggers when someone else joins if I open it to lan.
and I cant call the Minecraft.getInstance().player; in the class because its null all the time.
also I tried calling the Minecraft.getInstance().player in the FMLClientSetupEvent but thats also equals to null
when is the player not null?...
Thank you in advance.
I'm trying to have my mod click on some stuff inside a chest but I cant get the right data
Im using the GuiOpenEvent to check of there is a chest open but no clue how I would get it to auto click on a item.
I tried getting the window id from the openContainer but its always 0
pls,,, help
im not sure how to get the id from the currently open chest.
Im using the GuiOpenEvent and I want the mod to auto click on something when a specific chest is opened.
I founnd the
playercontroller.windowClick
method, but for that I need the window id from the chest.
If I use
theplayer.openContainer.windowId
I get 0 everytime I open a chest even though I checked of the gui was a instance of Guichest.
Is there also a way to get the name of the chest (like how you can rename chest with anvils and see the name at the top where it use to say chest)?
Thank you in advance.