- 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.





dEssentials Home Menu


By n0nnie
Created: 2018/10/27 13:00:51 UTC-07:00 (6 years and 58 days ago)
Edited: 2018/10/27 13:13:08 UTC-07:00 (6 years and 58 days ago)
Likes: 0

Denizen Version: 1.0.2-SNAPSHOT (build 1651)
Script Version: 0.7.6
Description:

Description:
=================================================
A little Menu, designed to work with Essentials. If you have more then 1 home the command /home will bring up a menu where you can decide where to go. This is designed to work with the home system of essentials, so it will show nothing if your server does not have essentials or essentialsx (see dependencies), or you are using another plugin which provides the /home command.

Dependencies:
================================================
- Depenizen
- Essentials or EssentialsX
- Vault (if Essentials uses Vault duh)

Notes:
=================================================
- This script is in German, you have to uncomment the comments and to comment the german lines vise versa, if you need english. A translationfile with a config seemed to be too much effort for this little script to change 6 lines in a 70 Line script ;)
- Regarding the bed Colors: If your players are able to have more then 16 homes, the 17th home (and further ones) will show as white beds. If the Maximum number of your allowed homes exceeds 15, I recommend to change the line 6 to your likings. At the moment it supports 15 homes, further homes will not be shown. (slotnumber - 3 == max shown home number)
- if <reader.suggestion.get[1]||null> != null {
- write me in discord n0nnie#2721
}


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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
7400

dessentials_home_menu:
  type: inventory
  debug: true
  inventory: chest
  title<red>Heim Menu
  size: 18
  definitions:
    # translate: uhu: i@human_skull[skull_skin=<player.name>;display_name=<&4>Your Home Menu;lore=<&2>The beds are showing your homes]
    uhu: i@human_skull[skull_skin=<player.name>;display_name=<&4>Das Heim Menu;lore=<&2>Die Betten zeigen Deine Heime]
    # translate: bed: i@bed:14[display_name=<&4>Your Bed;lore=<&2>Only for bed owners]
    bedi@bed:14[display_name=<&4>Dein Bett;lore=<&2>Nur, wenn Du ein Bett hast]
    
  procedural items: 
    - define list li@ 
    - foreach <player.home_name_list>: 
      - define item i@bed:<def[loop_index].sub[1]>[lore=<def[value]>]
      #translate: - adjust <def[item]> display_name:Teleportingtarget save:item
      - adjust <def[item]> display_name:Teleportziel save:item
      - adjust <entry[item].result> "lore:<def[value]>" save:item
      - define item <entry[item].result>
      - define list <def[list].include[<def[item]>]> 
    - determine <def[list]> 
    
  slots:
    - "[uhu] [bed] [i@air] [] [] [] [] [] [] "
    - "[] [] [] [] [] [] [] [] []"
    
dessentials_home_menu_handler:
  type: world
  debug: true
  events:
    on player clicks in dessentials_home_menu:
    - if <c.item.material.contains[bed]> {
      - if <c.item.display.contains[Dein<&sp>Bett].not> {
        - execute as_player "home <c.item.lore.get[1]||ibash>"
        #translate: - narrate "<&6>You are going to your home: <&2><c.item.lore.get[1]||ibash>"
        - narrate "<&6>Du gehst zu Deinem Heim<&2><c.item.lore.get[1]||ibash>"
        - inventory close d:<c.inventory>
        - queue clear
      }
      - if <player.bed_spawn> == null {
        #translate - narrate "<&4>You do not own a bed, where you can go to!"
        - narrate "<&4>Du hast kein Bett, zu dem Du teleportieren kannst!"
        - queue clear
      }
      else {
        - execute as_player "home bed"
        - queue clear
      }
    }  
    - determine passively cancelled
    on home command:
    - if <player.has_permission[essentials.home].not> {
      #translate: - narrate "<&4>You do not have the permission to use this!"
      - narrate "<&4>Du hast nicht die Permission, dies zu benutzen!"
    }
    - if <c.args.get[1]||null> == null && <player.home_name_list.size> >= 2 && <player.has_permission[essentials.home]> {
      - inventory open d:in@dessentials_home_menu
      - determine fulfilled
    }
    - if <c.args.get[1]||null> != null && <player.home_name_list.size> < 2 && <player.has_permission[essentials.home]> {
      - queue clear
    }
    
home_menu_version:
  type: dessentials_home_menu
  name: dEssentials Home Menu
  description: /home brings up a menu for your homes
  version: 0.7.6
  author: n0nnie
  id: 151







View History