mirror of
https://github.com/zeshan321/ActionHealth.git
synced 2024-11-14 23:05:11 +01:00
Check if gamemode is null because of fake player npcs
This commit is contained in:
parent
c484591d2a
commit
84f510bb78
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: ActionHealth
|
||||
main: com.zeshanaslam.actionhealth.Main
|
||||
version: 3.2.0
|
||||
version: 3.2.1
|
||||
commands:
|
||||
Actionhealth:
|
||||
description: Actionhealth main command.
|
@ -38,8 +38,8 @@ public class HealthUtil {
|
||||
if (entity instanceof Player) {
|
||||
Player player = (Player) entity;
|
||||
|
||||
// Using string version for older versions
|
||||
if (player.getGameMode().name().equals("SPECTATOR")) {
|
||||
// Using string version for older versions. Checking for gamemode is null because of fake player npcs.
|
||||
if (player.getGameMode() != null && player.getGameMode().name().equals("SPECTATOR")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user