Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

How can I send a message to all players as me by my mode? What should i use and import?

Edited by Gumanat

  • Author
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".  

  • Author
1 minute ago, diesieben07 said:

Please learn basic Java.

I ask on the FORGE forum for a question about FORGE

  • Author
1 minute ago, diesieben07 said:

And you have been given an answer.

So how to send message?

  • Author
2 minutes ago, diesieben07 said:

You call this method.

Please tell me more i so need it. How to put text there?

  • Author
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

  • Author
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

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.

  • Author
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

  • Author
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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.