GithubHelp home page GithubHelp logo

tptoscoreboardvalues's Introduction

TPTS - Teleport to Scoreboard

Why ?

This datapack permits you to teleport a player to coordinates specified in a scoreboard. Why use this ? Because it's easier than recreate this in your datapack. There is only passives functions (no tick functions or loops with schedules) so while you don't use it, it doesn't impact your perfs.

  • setup values of the scoreboard
  • tp the player or entity with one command

How ?

Set coordinates manualy

The destination coordinates are stored in only one scoreboard called tpts_destination. In $x, $y and $z score holders. So you can manualy change this values with the /scoreboard command.

For example :

scoreboard players set $x tpts_destination 42
scoreboard players set $y tpts_destination 100
scoreboard players set $z tpts_destination 69

The destination is now x:42 y:100 z:69.

This datapack also include a relative option. If you activate this feature on one axis, when you will teleport the player or the entity, the destination coordinates of this axis will be ignored. This feature permits you a sort of /tp 42 ~ 69. Set the value of $x_isRelative to 1 if you want to use this on the x axis. Same thing for the 2 other.

Example :

scoreboard players set $x tpts_destination 42
scoreboard players set $y_isRelative tpts_destination 1
scoreboard players set $z tpts_destination 69

The destination is now x:42 y:~ z:69.

Set coordinates with build-in functions

There is 2 functions that can help you in your datapacks to setup coordinates.

function tptoscoreboard:command/store_position

Executable as entities that store its position in the scoreboard.

Note : the execute at @s isn't required and the execute positioned will not have an impact.

function tptoscoreboard:command/reset_coordinates

You can use this function if you want to reset quickly the destination coordinates. By default, the coordinates will be x:0 y:0 z:0 and the relative feature desactivated.

Teleport

To teleport a player or an entity just run as them :

function tptoscoreboard:command/tp

Note : execute at @s is required before if you want to use the relative option, and then eexcute positioned will have an impact.

tptoscoreboardvalues's People

Contributors

neylz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.