Skip to content

Commit 23dea63

Browse files
Make previously targetting mobs ignore players with SCP-268
Made mobs that were previously targetting the player ignore the player as soon as they put on SCP-268.
1 parent a9bf204 commit 23dea63

File tree

1 file changed

+9
-0
lines changed
  • src/main/java/dev/enderman/minecraft/plugins/scp/items

1 file changed

+9
-0
lines changed

src/main/java/dev/enderman/minecraft/plugins/scp/items/SCP268Item.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import foundation.esoteric.minecraft.plugins.library.item.TexturedItem
66
import gg.flyte.twilight.extension.hidePlayer
77
import gg.flyte.twilight.extension.showPlayer
88
import org.bukkit.Material
9+
import org.bukkit.entity.Mob
910
import org.bukkit.event.EventHandler
1011
import org.bukkit.event.entity.EntityTargetLivingEntityEvent
1112
import org.bukkit.potion.PotionEffect
@@ -34,6 +35,14 @@ class SCP268Item(plugin: SCPPlugin) : TexturedItem(plugin, "scp_268", Material.L
3435
false
3536
)
3637
)
38+
39+
for (entity in player.world.livingEntities) {
40+
if (entity !is Mob) continue
41+
42+
if (entity.target != player) continue
43+
44+
entity.target = null
45+
}
3746
}
3847

3948
if (isItem(oldItem)) {

0 commit comments

Comments
 (0)