Added explode feature

This commit is contained in:
5vl 2022-05-30 22:09:40 +02:00
parent e02ed3a142
commit 7501801e48
No known key found for this signature in database
GPG Key ID: DA8938F22548E4D5
3 changed files with 16 additions and 0 deletions

View File

@ -44,4 +44,9 @@ object Trolls {
ps.playSound(ps.location, Sound.ENTITY_CREEPER_PRIMED, 1.0f, 1.0f)
p.sendMessage(Utils.color("<color:#4747ff>${ps.name} has been scared!</color>"))
}
fun explode(p: Player, ps: Player) {
ps.location.createExplosion(1.0f, false, false)
p.sendMessage(Utils.color("<color:#4747ff>${ps.name} has been exploded!</color>"))
}
}

View File

@ -17,6 +17,7 @@ object TrollGui {
gui.setItem(3, getSpinItem())
gui.setItem(4, getIgniteItem())
gui.setItem(5, getScareItem())
gui.setItem(6, getExplodeItem())
inTrollGui[from] = target
return gui
}
@ -75,6 +76,15 @@ object TrollGui {
return item
}
private fun getExplodeItem(): ItemStack {
val item = ItemStack(Material.TNT)
val meta = item.itemMeta
meta.displayName(Utils.color("<color:#780600>Explode</color>"))
meta.lore(Utils.loreBuilder("This will explode the player.", "Will do damage but won't break blocks!"))
item.itemMeta = meta
return item
}
/* ITEM DEFAULT SETUP
private fun item(): ItemStack {
val item = ItemStack(Material.)

View File

@ -21,6 +21,7 @@ class InvClickListener : Listener {
3 -> Trolls.spin(p, ps)
4 -> Trolls.ignite(p, ps)
5 -> Trolls.scare(p, ps)
6 -> Trolls.explode(p, ps)
}
TrollGui.inTrollGui.remove(p)
p.closeInventory()