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. Here is a summary of functions; to have complete documentation on what each function does, see the actual function file.

anger.mcfunction
Simulates the damaging of the sender by another '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 a given amount of health. 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.

get_motion.mcfunction
Returns the motion of the sender to three scores, scaled up by 1000 and rounded to integers.

get_rotation.mcfunction
Returns the direction of the sender to two scores, rounded to integers.

get_position.mcfunction
Returns the position of the sender to three scores, rounded to integers.

get_uuid.mcfunction
Saves the UUIDMost/UUIDLeast pair to the save chunk, which can be used by other functions such as aestd:entity/anger.

set_position.mcfunction
Sets the position of the sender from three scores, rounded to integers.

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.

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_damage.mcfunction
Adds the sender's aestd.item_dmg score to the damage of an item. If this score is negative, the item will be repaired instead of damaged.

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

add_lore.mcfunction
Adds a line of lore to an item from a text component saved to the save chunk (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 all attribute modifiers of an item.

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

remove_enchantments.mcfunction
Removes all enchantments of 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 the sender's aestd.item_count score, limiting to the item's stack size. Setting it to 0 or any negative value will delete the item.

set_damage.mcfunction
Sets the damage of an item to the sender's aestd.item_dmg score.

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

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

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