• check_circle Advancements
  • check_circle Functions
  • 9,684 views, 6 today
  • 570 downloads, 0 today
  • 10
  • 9
  • 16
mrurl42's Avatar mrurl42
Level 42 : Master Procrastinator
24
This will allow players to teleport using triggers (or not depending on the options set by the admin).

There will be a link on /reload to the options, or the admin can just run /function teleport:options

Only tested on 1.15, but should work in 1.13+ (if someone tests this, please confirm).

To install, just drop teleport.zip into your world's datapacks folder.


Currently implemented:
  • Fully functional (clickable) options menu (function teleport:options)
  • /trigger teleport_spawn (teleports you to the set spawn point)
  • /trigger teleport_player (shows the error message telling you how to use the command)
  • /trigger teleport_player set # (teleports you to the player numbered #)
  • Player list shows the score to see the player's number
  • Will ignore players with the following tags: global.ignore, global.ignore.pos
  • Will play nice with certified datapacks
    CompatibilityMinecraft 1.13
    toMinecraft 1.16
    Tags

    3 Update Logs

    Update #3 : by mrurl42 05/02/2020 2:07:04 pmMay 2nd, 2020

    Added conventions to ignore anyone with the global.ignore tag or the global.ignore.pos tag. Also added the "installed datapacks" advancement.
    LOAD MORE LOGS

    Create an account or sign in to comment.

    NikoKun
    05/28/2022 12:36 pm
    Level 36 : Artisan Professor
    NikoKun's Avatar
    EDIT: Never mind.. Somehow an armor_stand tagged teleport_spawn had been moved to a strange place, and I think that's what was causing the issue..

    I'm having an odd issue, where the teleport_spawn command won't work if I'm over 300ish blocks away from spawn..

    I can't figure out what might be causing it, cause spawn should always be loaded in memory, and nothing in the code mentions that distance, so I dono why that would happen.. even with other players standing near spawn, I can't use this command to tp to spawn if I'm over 300 away.
    Maybe the armor_stand for teleporting the player to spawn, can't be created more than 300 blocks away from the player? Maybe instead, just place a Marker entity at the user-inputting spawn location, and leave it there, as a reference?

    Also, side note, have you thought of changing some of the armor_stands to Marker entities?
    2
    mrurl42
    05/29/2022 9:33 am
    Level 42 : Master Procrastinator
    mrurl42's Avatar
    This was made back in 1.16 before the marker entity. I would maybe consider it for some of the pieces (like the stand at spawn) but might have to rework some things because of the way markers work. It looks like lots of commands cannot be used on markers, but it might work for some things.
    2
    NikoKun
    05/29/2022 2:05 pm
    Level 36 : Artisan Professor
    NikoKun's Avatar
    Ah. Makes sense.

    BTW, I found a better way to disable people from TPing to certain players.. Just setting those player's tele_player_num to a negative number, seems to work! ;)
    2
    NikoKun
    05/11/2022 4:33 pm
    Level 36 : Artisan Professor
    NikoKun's Avatar
    Still works great for me! Thnx for this, it's exactly what my server needed! ;)

    edit: Just curious, what's the diff between the tags global.ignore and global.ignore.pos I can't tell from looking at the code, since both tags are always checked?..
    Also, is there a way to prevent players from teleporting TO a specific user? For example, if I want to prevent players from teleporting to ops.. (I assume it could be done by tagging those users, then checking whether the destination user has those tags, before sending players to them.)
    2
    mrurl42
    05/12/2022 12:53 pm
    Level 42 : Master Procrastinator
    mrurl42's Avatar
    This was to bring it in line with the MC Datapacks conventions. So if someone was set to global ignore then you "shouldn't change them at all" and if they were set to global ignore pos then you shouldn't change their position... since that is ALL this pack does, both would be the same in this case.
    2
    NikoKun
    05/13/2022 12:28 am
    Level 36 : Artisan Professor
    NikoKun's Avatar
    Ah okay cool!
    Well, so far it's working pretty good. Tho I'm still trying to figure out how to have it ignore destination players if they're in spectate mode, or who have a special tag marking them as an op.
    It might as well ignore teleporting people to Ops, cause ops can use the normal teleport commands. ;)

    edit: In the tick.mcfunction file, does it make sense to exclude my Op-team from the "Handle adding new players" line, like so?
    scoreboard players add @a[​team=!Ops] tele_player_num 0
    as well as the following execute line maybe..
    edit2: well.. that seems to half work..
    2
    mrurl42
    05/15/2022 12:59 pm
    Level 42 : Master Procrastinator
    mrurl42's Avatar
    So that line just ensures that players joining the server HAVE a "tele_player_num" score (0 in this case). Without a value on that, you cant do anything else with it. This would work to keep any new Ops from being able to use this, but ones that have already logged in would have that scoreboard active. Try deleting that score from people on the Ops team and as long as you have that line in place it shouldnt REadd them
    2
    DatDamnDutchie
    12/05/2021 10:28 am
    Level 1 : New Miner
    DatDamnDutchie's Avatar
    Hi man, long time, I still use the script! But now in 1.18 the numbers havent been showing up in TAB, so no one knows their number.. Do you know why maybe?

    Thanks!
    1
    mrurl42
    12/07/2021 10:58 pm
    Level 42 : Master Procrastinator
    mrurl42's Avatar
    I looked at the 1.18 changes and there is nothing I can see that would stop it from working. My guess is the changes to the scoreboard turned yours off. Just rerun the command to add it back and it should show back up I hope.

    /scoreboard objectives setdisplay list tele_player_num

    Alternatively, you could just turn off the player teleport option and turn it back on. This would reset the objective display like the above command would.
    2
    DatDamnDutchie
    12/10/2021 3:19 pm
    Level 1 : New Miner
    DatDamnDutchie's Avatar
    I seem to have a problem with permissions now, it says "You can not trigger this objective yet" for whoever tries to teleport to someone else. Any ideas?
    1
    Planet Minecraft

    Website

    © 2010 - 2024
    www.planetminecraft.com

    Welcome