User:Aeldrion/Projects/AESTD

AESTD is a utility datapack written by Aeldrion for Minecraft vanilla 1.14 that adds useful functions and tools to help making complex command systems easier. Its development started in July 2018.

= Features =

AESTD function library
The AESTD function library is the biggest feature of AESTD. It is divided in six folders: entity, item, block, player, math and context. Every function contains a comment documentation stating in what snapshot or version the function was last tested.

anger.mcfunction
Simulates the damaging of the sender by a 'target entity' whose UUID was saved in the save chunk with the aestd:entity/get_uuid function. If the entity is neutral or hostile, it will become angry at the target entity. If the target entity is a player, the entity's death will count as a player kill and experience orbs will drop.

damage.mcfunction
Damages the sender by its aestd.damage score divided by 100. Can be set to burn or anger the damaged the entity with aestd:entity/anger function.

get_direction.mcfunction
Returns the direction of the sender to three scores, scaled up by 1000 and rounded to integers. Output: aestd.dir.x, aestd.dir.y, aestd.dir.z

get_motion.mcfunction
Returns the motion of the sender to three scores, scaled up by 1000 and rounded to integers. Output: aestd.motion.x, aestd.motion.y, aestd.motion.z

get_rotation.mcfunction
Returns the direction of the sender to two scores, rounded to integers. Output: aestd.rot.x, aestd.rot.y

get_position.mcfunction
Returns the position of the sender to three scores, rounded to integers. Output: aestd.coords.x, aestd.coords.y, aestd.coords.z

get_uuid.mcfunction
Saves the UUIDMost/UUIDLeast pair to the save chunk, which can be used by other functions such as aestd:entity/anger. Output: (1519204 6 0) RecordItem.tag.aestd.EntityUUIDMost, (1519204 6 0) RecordItem.tag.aestd.EntityUUIDLeast

set_position.mcfunction
Sets the position of the sender from three scores. Input: aestd.coords.x, aestd.coords.y, aestd.coords.z

tame.mcfunction
Tames the sender and sets its owner to a player whose UUID was saved in the save chunk with the aestd:player/get_uuid function. Input: (1519204 6 0) RecordItem.tag.aestd.PlayerUUID

teleport_to_chunk_corner.mcfunction
Teleports the sender to the westernmost, northernmost corner of the chunk it is in. Does not work for players.

Item
Item functions modify an item of a player's or a mob's inventory. The item slot that is used is defined by the aestd.item_slot score of the sender. If set to -1, it will select the sender's mainhand item. If set to -2 or -106, it will selected the sender's offhand item. If set to any other value, it will select the corresponding slot ID (example: 4 will select the fifth hotbar slot, 101 the legs slot. Armor slots will work for mobs even though there is no slot ID for mobs' item slots).

add_count.mcfunction
Adds a score to the count of an item, limiting to the item's stack size. Input: aestd.item_count

add_custom_model_data.mcfunction
Adds a score to the custom model data field of an item. Input: aestd.item_cmd

add_damage.mcfunction
Adds a score to the damage of an item. If this score is negative, the item will be repaired instead of damaged. Input: aestd.item_dmg

add_lore.mcfunction
Adds a line of lore to an item from a text component saved to the save chunk. Input: (1519204 6 0) RecordItem.tag.aestd.String

load.mcfunction
Loads an item from the save chunk, previously saved with the aestd:item/save function.

remove_attribute_modifiers.mcfunction
Removes attribute modifiers from an item.

remove_data.mcfunction
Clear the entire item's NBT data (name, enchantments, lore, damage…)

remove_enchantments.mcfunction
Removes enchantments from an item.

save.mcfunction
Saves an item to the save chunk. This function is used internally by most item functions.

set_count.mcfunction
Sets the count of an item to a score, limiting to the item's stack size. Setting the score to 0 or any negative value before running this function will delete the item. Input: aestd.item_count

set_custom_model_data.mcfunction
Sets the custom model data field of an item to a score. Input: aestd.item_cmd

set_damage.mcfunction
Sets the damage of an item to a score. Input: aestd.item_dmg

load.mcfunction
Loads a previously saved block to the block at context position.

randomize_structure_block.mcfunction
Randomizes the mirror and the rotation of the load structure block at context position.

save.mcfunction
Copies the block at context position to the save chunk.

set_skull_owner.mcfunction
Sets the owner of the player head at context position to a player whose name was previously saved by the aestd:player/get_name function.

get_biome.mcfunction
Saves the biome ID at context position to the sender's aestd.biome score.

get_position.mcfunction
Saves the context position to 3 scores, rounded to integers.

get_rotation.mcfunction
Saves the context rotation to 2 scores, rounded to integers.

load_chunk.mcfunction
Loads the chunk in which this function runs for the current tick.

get_block_looking_at.mcfunction
Finds the coordinates of the block the player is looking at up to 80 blocks away. Resets scores if the player isn't looking at a block.

get_name.mcfunction
Saves the name of the player to the save chunk.

get_spawnpoint.mcfunction
Saves the player's spawnpoint to 3 scores.

get_uuid.mcfunction
Saves the entire UUID of the player to the save chunk (not the same as aestd:entity/get_uuid, which saves the UUIDLeast/UUIDMost pair).

set_experience_levels.mcfunction
Sets the player's experience levels to a score.

set_position.mcfunction
Teleports the player to coordinates from 3 scores. aestd:entity/set_position does not work on players.

Math
Most math functions take input from the sender's aestd.math.in and aestd.math.in2 scores and send output to the sender's aestd.math.out score. If there is no sender, input will be taken from and output will be sent to #aestd's scores.

absolute.mcfunction
Returns |x|

cos.mcfunction
Returns 1000*cos(x) where x is an angle in degrees

power.mcfunction
Returns x^x2 where x2 is in the range [1;30]

random.mcfunction
Returns a random integer between 0 and aestd.random.max (excluded)

random_range.mcfunction
Returns a random integer in the [aestd.random.min;aestd.random.max[ range

sin.mcfunction
Returns 1000*sin(x) where x is an angle in degrees

add_marker.mcfunction
Summons a marker entity (area effect cloud) at given coordinates with an aestd.marker tag for the current tick. Only one marker can exist at any given time; adding a marker will remove the last marker. Input: aestd.coords.x, aestd.coords.y, aestd.coords.z

get_daytime.mcfunction
Saves the current period of the day to the sender's aestd.time.dayp score.

get_moon_phase.mcfunction
Saves the current moon phase to the sender's aestd.time.moon score.

get_weather.mcfunction
Saves the current weather to the sender's aestd.weather score.

Useful tags
AESTD also features several item, block and entity tags.

Summary of item tags
,,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,

Summary of entity type flags
,,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,

Summary of block tags
,,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,

TPS calculator
The TPS calculator is a tool of the  namespace. It evaluates the ticks per second on a ten second period. To use the TPS calculator, use the command.

It uses the shrinking of the world border to compare ticks and actual time. When a TPS test has started, it must end before another TPS test starts.

Save chunk
The save chunk (positioned at x=1519204, z=0) is a chunk that AESTD uses to save data used by other functions. When AESTD is loaded for the first time in a new world, it will ask players to run a /forceload command to mark that chunk for force loading. Its loading is essential for many functions to work.

= Datapack structure =

= Guides =

= Download =

= Links =

GitHub repository

“Aeldrion Creations” Discord server