Jump to content

Player for ClientChatEvent [ solved ]


Kemuri  Senpai

Recommended Posts

I am catching Message send from Client and want to cancel it if it vontains some special words. This is fine.

 

However, I also want to write text back to the player ( also Client Side ).

 

Normally I use

´´´player.sendStatusMessage( new StringTextComponent("[ §1Place§r ] Set brightness to §4§l", brightness ), (false));´´´

But "entity" is not returned by ClientChatEvent... So, how?

 

(Minecraft 1.15.2)

Edited by Kemuri Senpai
solved my problem
Link to comment
Share on other sites

31 minutes ago, diesieben07 said:

You need an instance of the Minecraft class to access non-static methods, this is basic Java knowledge.

Now, Minecraft is a singleton. It should be very obvious from that what you need to do to get the instance.

So... It will work with

Minecraft.getInstance ( ).player ?

Sorry for this dumb questions, I was modding for Minecraft about half a year only using Scratch-like programm (MCreator).

I know almost nothing about Java and coding, so this all is foreign terrain to me 🤷‍♂️

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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