Paste #17664: Navigator v0.1

Date: 2015/07/08 19:16:36 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# Name: Navigator
# Author: Xenmai
# Version 0.1

NavigatorItem:  
    type: item
    display name: <&c>Navigator
    material: nether_star
    lore:
        - <&b>Right-click with the <&e>Navigator
        - <&b>in your hand to select a warp
        - <&b>destination

NavigatorMenuOption1:
    type: item
    display name: <&c>PvP
    material: iron_sword[flags=li@HIDE_ATTRIBUTES]

NavigatorMenuOption2:
    type: item
    display name: <&a>Survival
    material: raw_beef

NavigatorMenuOption3:
    type: item
    display name: <&e>Minigames
    material: sugar

NavigatorMenu:
    type: inventory
    title: Navigator Menu
    size: 27
    slots:
        - "[] [] [] [] [] [] [] [] []"
        - "[] [] [] [i@NavigatorMenuOption1] [i@NavigatorMenuOption2] [i@NavigatorMenuOption3] [] [] []"
        - "[] [] [] [] [] [] [] [] []"

NavigatorListener:
    type: world
    events:
        on navigator command:
            - give i@NavigatorItem
            - narrate "<&b>You received the <&e>navigator<&b>!"
        on player right clicks block with NavigatorItem:
            - inventory open d:in@NavigatorMenu
        on player clicks in NavigatorMenu:
            - if <context.slot> == 13 {
                - narrate "<&b>Teleporting to PvP"
            }
            else if <context.slot> == 14 {
                - narrate "<&b>Teleporting to Survival"
            }
            else if <context.slot> == 15 {
                - narrate "<&b>Teleporting to Minigames"
            }
            - inventory close
            - determine CANCELLED
        on player drags in NavigatorMenu:
            - determine CANCELLED