Changing player stats/effects?
Hi, I am working on a plugin for GodMode for Hurtworld and in order to get it work properly I have to find out how to change specific stat like eg. Radiation, Hungry or Health. I found sth like this session.WorldPlayerEntity.GetComponent<EntityStats>() but I don't know how to change value for one stat only. I mean how can I get access to it.

Any advice is welcome :D

Best way to get GodMode working is using the OnPlayerTakeDamage hook, but this hook is currently not working.
We are trying to get this working again but it might take a bit till we find a way to fix it.

Here you have an example how to change the health of a player:

EntityStats stats = session.WorldPlayerEntity.GetComponent<EntityStats>();
stats.GetFluidEffect(EEntityFluidEffectType.Health).SetValue(100f);
Here is the problem, becuase EEntityFluidEffectType does not exist and can't compile. I have tried it. Actually I have figured out all effects with names, but still no idea how to change particular one values.

PS OnPlayerTakeDamage works somehow, but not properly for sure :D
 
In response to LoOp ():
Here is the problem, becuase EEntityFluidEffectType does not exist and can't compile. I have tried i...
        private void OnPlayerConnected(PlayerSession session) => SetHealth(session, 50f);

        private void SetHealth(PlayerSession session, float value)
        {
            EntityStats stats = session.WorldPlayerEntity.GetComponent();
            IEntityFluidEffect health = stats.GetFluidEffect(EntityFluidEffectKeyDatabase.Instance.Health);
            health.SetValue(value);
        }

Here's a small example, this will set players health to 50% when he connects to the server.