Skip to content

Commit

Permalink
fix: make void not damage when god/invulnerable
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Feb 22, 2024
1 parent d2bc760 commit d97986b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mineinabyss.extracommands

import com.mineinabyss.extracommands.listeners.AfkListener
import com.mineinabyss.extracommands.listeners.GodListener
import com.mineinabyss.idofront.di.DI
import com.mineinabyss.idofront.plugin.listeners
import org.bukkit.plugin.java.JavaPlugin
Expand All @@ -12,7 +13,8 @@ class ExtraCommands : JavaPlugin() {
ExtraCommandExecutor()

listeners(
AfkListener()
AfkListener(),
GodListener()
)

ExtraPlaceholders().register()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mineinabyss.extracommands.listeners

import com.mineinabyss.idofront.messaging.broadcast
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.entity.EntityDamageEvent

class GodListener : Listener {

@EventHandler
fun EntityDamageEvent.onDamage() {
if (!entity.isInvulnerable) return
isCancelled = true
entity.fallDistance = 0f
}
}

0 comments on commit d97986b

Please sign in to comment.