Paste #41586: Untitled Paste

Date: 2017/04/27 09:05:53 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


HoldPortalE:
  type: entity
  entity_type: e@armor_stand[arms=true;base_place=false;gravity=false;visible=false]
  max_health: 1
  health: 1
  can_pickup_items: false
  equipment: air|air|air|i@HoldPortalHead

TinyHoldPortalE:
  type: entity
  entity_type: e@armor_stand[arms=true;base_place=false;gravity=false;visible=false;is_small=true]
  max_health: 1
  health: 1
  can_pickup_items: false
  equipment: air|air|air|i@HoldPortalHead

HoldPortalHead: 
  type: item 
  material: i@human_skull[display_name=Chest;skull_skin=bc133ef0-71cb-4d54-adfa-79b2135b029c|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmQ4MzJlZjAyYmJhN2I5YTZiNzlkNGE5NmYzYjFiMjRhZmEwMzA5ODQ1NjUyZmVjZDYxZDRlOTg1Zjc2ODIifX19]
  display name: <&7><&l>Reward Chest
  lore:
  - <&9>Epic

HoldPortalItem: 
  type: item 
  material: i@human_skull[display_name=Chest;skull_skin=bc133ef0-71cb-4d54-adfa-79b2135b029c|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmQ4MzJlZjAyYmJhN2I5YTZiNzlkNGE5NmYzYjFiMjRhZmEwMzA5ODQ1NjUyZmVjZDYxZDRlOTg1Zjc2ODIifX19]
  display name: <&5><&l>Hold Portal
  lore:
  - <&8>Miscellaneous
  - <&7>With this you can make
  - <&7>a portal between 2 locations
  - <&7>inside of your own Hold or
  - <&7>your Hold and an ally's Hold.
  - <&7>Left click to set the First Position
  - <&7>Right click to set the Second Position

RightClickHoldPortalItem:
  type: world
  events:
    on player right clicks with HoldPortalItem:
    - ^determine cancelled passively
    - ^flag <pl> RightPortal:<pl.location.simple>
    - ^narrate "<&5>Second Position set to: <&d><pl.location.simple>"
    - if <pl.flag[LeftPortal]> != null narrate "<&5>Both locations are set, if you want to create the portal type /hold portalconfirm"

LeftClickHoldPortalItem:
  type: world
  events:
    on player left clicks with HoldPortalItem:
    - ^determine cancelled passively
    - ^flag <pl> LeftPortal:<pl.location.simple>
    - ^narrate "<&5>First Position set to: <&d><pl.location.simple>"
    - if <pl.flag[RightPortal]> != null narrate "<&5>Both locations are set, if you want to create the portal type /hold portal"

HoldPortalCommand:
  type: world
  events:
    on hold command:
    - if <context.args.get[1]||null> != null {
      - if <context.args.get[1]> == portal && <context.args.get[2]||null> == null {
        - ^flag <pl> HoldPortalConfirm:1 duration:10s
        - ^narrate "<&5>If you want to make the Portals at: <&d><pl.flag[LeftPortal]> <&5>and <&d><pl.flag[RightPortal]> <&5>type /hold portal confirm, within 10 seconds."
        - ^determine passively FULFILLED
        }
      - if <context.args.get[1]> == portal && <context.args.get[2]||null> == confirm {
        - if <pl.flag[HoldPortalConfirm]> == 1 {
          - ^flag <pl> LeftPortal:!
          - ^flag <pl> LeftPortal:!
          - ^flag <pl> HoldPortalConfirm:!
          - ^determine passively FULFILLED
          - ^chunkload <pl.flag[LeftPortal].as_location.chunk> duration:10s
          - ^chunkload <pl.flag[RightPortal].as_location.chunk> duration:10s
          - ^spawn HoldPortalE <pl.flag[LeftPortal].as_location> save:Portal
          - ^flag <entry[Portal].spawned_entities.get[1]> Owner:<pl.name>
          - ^flag <entry[Portal].spawned_entities.get[1]> Number:1
          - ^flag <entry[Portal].spawned_entities.get[1]> LocationOther:<pl.flag[RightPortal].as_location>
          - ^flag <entry[Portal].spawned_entities.get[1]> IDOther:0
          - ^flag <pl> ID1:<entry[Portal].spawned_entities.get[1]>
          - ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,0.6,0]>
          - ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,1.0,0]>
          - ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0.2,0.8,0]>
          - ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[-0.2,0.8,0]>
          - ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,0.8,0.2]>
          - ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,0.8,-0.2]>
          - ^wait 1t
          - ^spawn HoldPortalE <pl.flag[RightPortal].as_location> save:Portal
          - ^flag <entry[Portal].spawned_entities.get[1]> Owner:<pl.name>
          - ^flag <entry[Portal].spawned_entities.get[1]> Number:2
          - ^flag <entry[Portal].spawned_entities.get[1]> LocationOther:<pl.flag[LeftPortal].as_location>
          - ^flag <entry[Portal].spawned_entities.get[1]> IDOther:0
          - ^flag <pl> ID2:<entry[Portal].spawned_entities.get[1]>
          - ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,0.6,0]>
          - ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,1.0,0]>
          - ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0.2,0.8,0]>
          - ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[-0.2,0.8,0]>
          - ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,0.8,0.2]>
          - ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,0.8,-0.2]>
          - ^flag <pl.flag[ID1].as_entity> IDOther:<pl.flag[ID2]>
          - ^flag <pl.flag[ID2].as_entity> IDOther:<pl.flag[ID1]>
          } else {
          - ^narrate "<&5>Use /hold portal."
          - ^determine passively FULFILLED
          }
        }
      }


RightClickHoldPortal:
  type: world
  events:
    on player right clicks at HoldPortalE:
    - narrate "t"

RightClickHoldPortal:
  type: world
  events:
    on player right clicks at TinyHoldPortalE:
    - narrate "<context.entity.location.find.living_entities.within[2].filter[scriptname.is[equals].to[HoldPortalE]].get[1].flag[Del]>"

SHoldPortalE:
  type: task 
  script: 
  - spawn HoldPortalE <p@headlessjoey.location> save:Portal
  - flag <entry[Portal].spawned_entities.get[1]> Del:1
  - spawn TinyHoldPortalE <p@headlessjoey.location.add[0,0.6,0]>
  - spawn TinyHoldPortalE <p@headlessjoey.location.add[0,1.0,0]>
  - spawn TinyHoldPortalE <p@headlessjoey.location.add[0.2,0.8,0]>
  - spawn TinyHoldPortalE <p@headlessjoey.location.add[-0.2,0.8,0]>
  - spawn TinyHoldPortalE <p@headlessjoey.location.add[0,0.8,0.2]>
  - spawn TinyHoldPortalE <p@headlessjoey.location.add[0,0.8,-0.2]>

HoldPortalR:
  type: task 
  script: 
  - ^remove <pl.location.find.living_entities.within[2].filter[scriptname.contains_any[TinyHoldPortalE|HoldPortalE]]>

###################