Minecraft Data Packs / Other

Relative Position Utility Datapack

  • check_circle Advancements
  • check_circle Functions
  • 1,631 views, 1 today
  • 40 downloads, 0 today
  • 1
  • 3
Initia_Nova's Avatar Initia_Nova
Level 25 : Expert Miner
2
This is a utility datapack designed to be used by other datapacks.

This datapack allows you to adjust the execute position of a function by a relative amount stored in scoreboard values. It does so without the use of entities or forceloaded chunks. World coordinates can also be used by calling the run function at 0 0 0.


Dependent Datapacks:
 Version:
  Run "/function in.relative_position:api/version" to get the current datapack version.
   #version.major in.rp will be set to the major version
   #version.minor in.rp will be set to the minor version
   #version.patch in.rp will be set to the patch version
  After calling this function, use the following lines of code to cleanup the scoreboard.
   scoreboard players reset #version.major in.rp
   scoreboard players reset #version.minor in.rp
   scoreboard players reset #version.patch in.rp
 Loading:
  Use the #in.relative_position:after_load function tag for dependent load functions.

Usage:
 Add a function to the tag #in.relative_position:check_tag with the following line of code.
  execute if data storage in:storage relative_position{tag:"<your namespaced function>"} run function <your namespaced function>
 To call <your namespaced function> at ~<x> ~<y> ~<z> use the following lines of code (or something similar).
  scoreboard players set #x in.rp <x>
  scoreboard players set #y in.rp <y>
  scoreboard players set #z in.rp <z>
  data modify storage in:storage relative_position.tag set value "<your namespaced function>"
  function in.relative_position:api/run

Limits:
 #x must be within +/- 67,108,863
 #y must be within +/- 4,095
 #z must be within +/- 67,108,863
 These limits allow relative position changes from and to any point within the Java Minecraft build area, including for custom dimensions. For more extreme cases, multiple runs can be used.
CompatibilityMinecraft 1.17
toMinecraft 1.18
Tags

2 Update Logs

Version 1.2.0 : by Initia_Nova 07/30/2021 12:37:34 pmJul 30th, 2021

Added a new function tag #in.relative_position:after_load.
 Allows dependent datapacks to run functions after this datapack loads.
LOAD MORE LOGS

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome