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.

AESTD function library
The AESTD function library is the biggest feature of AESTD. It is divided in seven folders:,  ,  ,  ,  ,   and. Every function contains a comment documentation stating in what snapshot or version the function was last tested.

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.

Setting up the save chunk
When you first load AESTD in your world, a message should appear in the chat, saying "WARNING - AESTD is not fully loaded. This may cause datapacks to malfunction." with a link suggesting a  command. Click it, and AESTD should load.
 * If you are not an administrator of the server: contact an administrator and ask them to run the following command:
 * If you are in singleplayer with cheats disabled: pause the game, click Open to LAN, set Allow Cheats to ON and click Start LAN world. You should now be able to run the command by clicking the link.

Merging your datapack with AESTD
If you want to share your datapack but don't want to tell people to download two datapacks, you can merge your datapack with AESTD by going through the following steps:


 * 1) Copy namespaces to your datapack. Open the AESTD datapack. Copy the ,   and   namespaces and move them to your datapack's   folder.
 * 2) Move loot tables to your datapack. Open the AESTD datapack. Go in   and copy loot tables to your datapack, under the   namespace. If your datapack modifies the player loot table or the orange shulker box loot table, make sure players still drop their heads when killed with   tag and that orange shulker boxes still drop only their contents when broken with a tool with the   NBT data.
 * 3) Merge  . Open your datapack. Go in   and add the following function:  . If there is no such file or directory, create it and copy from.
 * 4) Merge  . Open your datapack. Go in   and add the following functions: ,   and  . If there is no such file or directory, create it and copy from.

High range pick block
https://streamable.com/m3qge

main.mcfunction (called every tick by tick.json) execute as @a[scores={rightClick=1..}] run function pick_block
 * 1) rightClick detects the use of a carrot on a stick

pick_block.mcfunction function aestd:player/get_block_looking_at function aestd:world/add_marker execute at @e[tag=aestd.marker] run function aestd:block/get_block_id scoreboard players set @s aestd.item_slot -1 function aestd:item/set_block_id scoreboard players reset @s rightClick

Area of damage
The following function will cause all players to have a 1% chance of damaging nearby mobs every tick

main.mcfunction scoreboard players set @a aestd.random.max 100 execute as @a run function aestd:math/random execute as @a[scores={aestd.random=0}] at @s run function damage

damage.mcfunction tag @e[type=!player,distance=..5] add damaged scoreboard players set @e[tag=damaged] aestd.damage 400 tag @e[tag=damaged] add aestd.damage.hurt_by_player execute as @e[tag=damaged] run function aestd:entity/damage tag @e remove damaged
 * 1) Damage by 4HP

Links
GitHub repository

“Aeldrion Creations” Discord server