Jump to content

Can't seem to check the tier of an active potion effect


DevDav
 Share

Recommended Posts

Hi,

on my SMP server, whenever you respawn you gain resistance at level 255 for 10 minutes as a sort of "grace period". Now I have this working jolly good and exactly how I want it to, but I also realized that someone could abuse this grace period by unfairly PVPing someone while they are invulnerable. So to remedy this, I need a way to disable fighting other players for any player who is in the grace period. I thought I could do this by checking if a player has resistance at tier 255, and while I can check if a player has resistance, I can't seem to figure out how to check what tier the effect is on! So I ended up making this Skript:

on damage of a player:
	if attacker is a player:
		loop active potion effects of attacker:
			if type of loop-potion effect is resistance:
				cancel event

And it works, the only problem is, without a way to check the tier of the resistance effect this also disables PVPing for players with resistance through a beacon or turtle master potion or any other legit method, which is unideal. Could anyone help me with this problem? How do you check the tier of a player's active potion effect?

Thanks in advance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share



×
×
  • Create New...