- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Ban Hammer


By jumpsplat120
Created: 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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
5700

#~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