Paste #128850: Portal Linking

Date: 2024/12/08 14:23:55 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


portal_linking:
    type: world
    enabled: true
    events:
        on entity teleported by portal:
        - announce <context.entity.location.world>
        - if <context.entity.location.world.environment> matches <element[NETHER]>:
            - define world <server.worlds.filter_tag[<[filter_value].advanced_matches[<context.entity.location.world.name.before_last[_nether]>]>]>
        - if <context.entity.location.world.environment> matches <element[NORMAL]>:
           - define world <server.worlds.filter_tag[<[filter_value].advanced_matches[<context.entity.location.world.name>_nether]>]>
        - if !<[world]>:
            - narrate "<&c>There is no world to teleport you to." t:<context.entity.as[player]>
            - determine cancelled
        - determine TARGET_WORLD:<[world].get[1]>
        on player uses portal from:end_portal:
        - if <player.location.world.environment> matches <element[THE_END]>:
            - define world <server.worlds.filter_tag[<[filter_value].advanced_matches[<player.location.world.name.before_last[_the_end]>]>]>
            - announce <[world]>
            - announce <[world].get[1].spawn_location>
            - determine <[world].get[1].spawn_location>
        - if <player.location.world.environment> matches <element[NORMAL]>:
            - define world <server.worlds.filter_tag[<[filter_value].advanced_matches[<player.location.world.name>_the_end]>]>
            - determine <location[100,49,0,90,0,<[world].get[1]>]>

        - if !<[world]>:
            - narrate "<&c>There is no world to teleport you to." t:<player>
        - determine cancelled