Jump to content

Recommended Posts

Posted
16 minutes ago, diesieben07 said:

PlayerList#broadcastSystemMessage

@EventHandler
    public void onServerChat(ServerChatEvent event) {
    	PlayerList#broadcastSystemMessage;
    }

is it correct? How to paste text there? Its not working: "Syntax error on token "Invalid Character", delete this token".  

Posted
2 minutes ago, diesieben07 said:

You call this method.

why is there "#"? I saw on forums that i need write server.getMinecraft().getPlayersList.sendMessage("text") but it was not working

Posted (edited)
14 minutes ago, diesieben07 said:

Please learn basic Java.

no its just error, not basic java🤣 you just gave me bad answer sorry

Edited by Gumanat
Posted

https://www.baeldung.com/java-method-in-javadoc#referencing-a-method-in-another-class

ClassName#method is the javadoc name for the method ClassName.method()

@diesieben07 told you it confuses people who don't write java professionally 🙂

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted
4 minutes ago, warjort said:

https://www.baeldung.com/java-method-in-javadoc#referencing-a-method-in-another-class

ClassName#method is the javadoc name for the method ClassName.method()

@diesieben07 told you it confuses people who don't write java professionally 🙂

Multiple markers at this line
    - Syntax error, insert ")" to complete NormalAnnotation
    - Syntax error, insert ";" to complete LocalVariableDeclarationStatement
    - Syntax error, insert "VariableDeclarators" to complete 
     LocalVariableDeclaration
    - Syntax error, insert "}" to complete BlockStatements
    - Syntax error on token "Invalid Character", @ expected
    - Syntax error, insert "[ ]" to complete Dimension

Posted
8 minutes ago, warjort said:

https://www.baeldung.com/java-method-in-javadoc#referencing-a-method-in-another-class

ClassName#method is the javadoc name for the method ClassName.method()

@diesieben07 told you it confuses people who don't write java professionally 🙂

why you just cant give me normal answer? Im not pro in Java. Why is there "#"? I dont need this. I need an ordinary example as it "player.sendMessage(new TextComponentString("This is sendmessage example string."));" i need function that can get argument - text. Can you give me an working example please? Without difficult examples

Posted

If you don't figure it for yourself and understand it, how will you know the code is correct?

How will you fix bugs when it breaks?

We are here to answer questions about forge, not teach you java or fix your code.

Here is what you asked for, but how do you know I am correct? 🙂

        // First navigate to the class you were told to use
        PlayerList players = chatEvent.getPlayer().server.getPlayerList();
        // Now send use the method you were told about
        players.broadcastSystemMessage(Component.literal("Hello"), ChatType.SYSTEM);

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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.

Announcements



×
×
  • Create New...

Important Information

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