Jump to content

Several configuration values for each player


kask

Recommended Posts

Hello. I'm new to Minecraft modding. I host a server for friends and family where players can play the game with their kids. Some younger kids have difficulties in game so I'm trying to create a mod where I can define hurt modifiers for some players so they take reduced damage on falling, monsters, etc.

I've read some documentations and for the most part I think I know how to achieve what I want. Only thing I can't seem to find any resources of is how to create a config file where I can set idividual settings for each player.

What I think I need to do is to create a server config file where I can set various modifiers for various hurt sources. Each player should have own values. I'm not yet familiar with toml file syntax so I'll throw json example what I try to achieve:

{
	"player1": {
		"fallDamage": 0.6,
		"physicalDamage": 0.3
	},
	"player2": {
		"fallDamage": 0.8
	}
}

Here "player1" will only get 60% of normal fall damage and 30% of physical damage. "Player2" has different modifiers. Rest of the players have no reduced effect.

Can someone point me to some resources to achieve this configuration type? Or write a minimal example how to define and read said config file. I'm using 1.19.2 if that makes any difference. Thanks!

 

 

Edited by kask
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.

Announcements



×
×
  • Create New...

Important Information

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