Jump to content

Recommended Posts

Posted

Hello, I am making a more of a client-side mod that is helping my datapack and I would like to know how I could set a server scoreboard objective value from the client. (when a player left clicks it sets their scoreboard - /scoreboard players set <player> <objective> <value> but in Forge). I am using Forge 1.18.1.

 

Something like:

@SubscribeEvent
public static void onMouseClick(TickEvent.ClientTickEvent e){
	if(e.phase == Phase.END){
    	Scoreboard s = server.getScoreboard();
      	Player p = ...;
        Objective obj = ...;
        Score score = ...;
        score.setScore(x);
    }
}

Thanks!

Posted
22 minutes ago, diesieben07 said:

You have to send the command to the server. That is the only way with a client-only mod.

So just p.chat("/scoreboard players....")?

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.