tModLoader A few questions about accessories

Ahndrek Li'Cyri

Skeletron Prime
Hello there! I just have a few questions about accessories.

1) How would you go about making a accessory do a thing only when a certain stat of the player is below a certain point, say making it regenerate life, but only when the player is below 50% health
I tried to do this
public override void UpdateAccessory(Player player, bool hideVisual)
    if(player.statLife <= (player.statLifeMax2 / 0.5f))
        player.lifeRegen += 1;
but it doesn't seem to work?

2) What would the proper way to increase the player's movement speed be, using player.moveSpeed or player.maxRunSpeed?

3) for making the player jump higher by a certain amount of tiles, how would i do that? I know using player.jumpSpeedBoost makes the jump higher but the numbers are arbitrary and i would like someway to do a specific tile amount instead, if possible.

4) Is it possible to have animated accessory sprites. If so, how would i do such?

Sorry if these questions have been answered a million times, trying to look around for them has lead to little or nut helpful results. I appreciate the help!
Top Bottom