@@ -6,12 +6,18 @@ import foundation.esoteric.minecraft.plugins.library.item.TexturedItem
6
6
import gg.flyte.twilight.extension.hidePlayer
7
7
import gg.flyte.twilight.extension.showPlayer
8
8
import org.bukkit.Material
9
+ import org.bukkit.entity.EntityType
9
10
import org.bukkit.entity.Mob
10
11
import org.bukkit.event.EventHandler
11
12
import org.bukkit.event.entity.EntityTargetLivingEntityEvent
12
13
import org.bukkit.potion.PotionEffect
13
14
import org.bukkit.potion.PotionEffectType
14
15
16
+ val unaffectedEntities = listOfNotNull<EntityType >(
17
+ EntityType .WARDEN ,
18
+ EntityType .ZOMBIE
19
+ )
20
+
15
21
class SCP268Item (plugin : SCPPlugin ) : TexturedItem(plugin, " scp_268" , Material .LEATHER_HELMET ) {
16
22
@EventHandler
17
23
private fun onEquip (event : PlayerArmorChangeEvent ) {
@@ -38,6 +44,8 @@ class SCP268Item(plugin: SCPPlugin) : TexturedItem(plugin, "scp_268", Material.L
38
44
for (entity in player.world.livingEntities) {
39
45
if (entity !is Mob ) continue
40
46
47
+ if (unaffectedEntities.contains(entity.type)) continue
48
+
41
49
if (entity.target != player) continue
42
50
43
51
entity.target = null
@@ -63,6 +71,10 @@ class SCP268Item(plugin: SCPPlugin) : TexturedItem(plugin, "scp_268", Material.L
63
71
64
72
@EventHandler
65
73
private fun onMobTarget (event : EntityTargetLivingEntityEvent ) {
74
+ val hostile = event.entity
75
+
76
+ if (unaffectedEntities.contains(hostile.type)) return
77
+
66
78
val target = event.target ? : return
67
79
68
80
val equipment = target.equipment ? : return
0 commit comments