Ban Hammer
By
jumpsplat120Created: 2016/07/13 21:28:17 UTC-07:00 (8 years and 164 days ago)
Edited: 2016/07/13 21:28:17 UTC-07:00 (8 years and 164 days ago)
Likes: 0
Denizen Version: 1617
Script Version: 1
Description:
It's very simple, it's a banhammer (a nether brick titled 'Banhammer'). Left click to ban someone, right click to unban the most immediate person. To obtain the ban hammer, simply use /banhammer, /hammer, or /bh.
Download script |
View raw script#~Banhammer Script v1 by Jumpsplat120
#
#/hammer, /bh or /banhammer to give yourself the Banhammer.
#I wouldn't suggest using it as a guide on how to code :p
#
#
HammerEvent:
type: world
events:
#The hammer is a custom nether brick. Only usable if an OP, otherwise does literally nothing.
on player damages entity with:HammerItem:
- if <context.damager.is_op> {
- if <context.damager> matches player {
- if <context.entity> matches player {
- flag <context.damager> banPlayer:<context.entity>
- flag <context.damager> banPlayerName:<context.entity.name>
- ban add <context.entity> "reason:You were hit with the banhammer!"
- narrate "You banned <context.entity.name>! Right click with the banhammer to unban them."
}
}
}
else {
- determine cancelled
}
on player right clicks with HammerItem:
- if <player.is_op> {
- Narrate "You have unbanned <player.flag[banPlayerName]>."
- ban remove <player.flag[banPlayer]>
}
#The custom Hammer. If you want to change what it looks like, change the material
HammerItem:
type: item
#Change this if you want the item to look different
material: i@nether_brick_item
display name: <reset>Banhammer
lore:
- <reset>Left click to ban someone.
- <reset>Right click to unban the most recent person.
#The command to give yourself the Ban Hammer. Only runs if you are OP.
Hammer Command:
type: command
name: Banhammer
description: Run this command to give yourself the banhammer item. (Command & item does nothing if you are not OP'd)
usage: /Banhammer OR /bh OR /hammer
aliases:
- bh
- hammer
script:
- if !<player.is_op||<context.server>> {
- narrate "<red>You do not have permission for that command."
- queue clear
}
else {
- give HammerItem
}
View History