WorldGuard

WorldGuard

8M Downloads

Potions hurt players even when PvP is disabled

LadyCailinBot opened this issue ยท 8 comments

commented

WORLDGUARD-2252 - Reported by sk89q

Potions hurt players even when PvP is disabled.

commented

Comment by sk89q

Dark_Arc said it may be a Bukkit issue. Not sure.

commented

Comment by Scrayos

You could set the Event as canceled, anyway - Don't you?

commented

Comment by sk89q

I don't know yet. Haven't personally looked not it. I'm pretty sure you can block this, but Dark_Arc says otherwise.

commented

Comment by yopsy

He says the PvP is disabled you must do this

For exampls with region: Spawn

/region define Spawn
/region flag Spawn potionsplash deny

this is all i hope i can help you

greetz D4rKBl4ckOut

commented

Comment by sk89q

I looked. It doesn't seem to be a Bukkit issue. I don't think Bukkit tells you actually threw the potion, but that's not an issue here.

commented

Comment by dddeeefff

Bukkit does (but may not have, ten months ago) have a function that could allow you to be able to fix this issue:
http://jd.bukkit.org/rb/doxygen/d4/db8/classorg_1_1bukkit_1_1event_1_1entity_1_1PotionSplashEvent.html
The potion splash event has a getPotion() method which returns a ThrownPotion which has the inherits the getShooter() method which returns a LivingEntity. Is is not possible to use instanceof to check if it's a Player (or offlinePlayer!) and act accordingly?

commented

Comment by Dark_Arc

I don't think it was setting the thrower... Or some weird thing like that... I can't remember though...

commented

Comment by Anon.anon

Hoorah. Thanks a bunch!