diff --git a/README.md b/README.md index 51cbf49..1e614b7 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,51 @@ The custom recipes are pretty self explanitory from just the names (_they follow - `minecraft/recipe/shulker_box_with_barrel_shapeless.json` - `minecraft/recipe/shulker_box_with_chest_shapeless.json` +## antigrief +I will explain this feature when I successfully add it into the datapack. + + +## cleanup +This feature adds tha ability to bring items within 16 blocks of the player to the players location using the following `trigger` command. +- `/trigger clean_up` ~ _Brings all droped items within 16 blocks to the players location._ + +## combatswitch +I will explain this feature when I successfully add it into the datapack. + + +## fastleafdecay +I will explain this feature when I successfully add it into the datapack. + + +## invframe +This feature adds the ability to _hide_, _show_, and _find_ a `minecraft:item_frame` or `minecraft:glow_item_frame`. When a `minecraft:item_frame` or `minecraft:glow_item_frame` is hidden, it is also fixed so that you don't have the item rotating or the frame breaking. When a `minecraft:item_frame` or `minecraft:glow_item_frame` is shown, it is unfixed so that you can rotate the item and break the frame. You can use this feature by using the triggers below. +- `/trigger find_frame` ~ _This makes it possible to find a `minecraft:item_frame` or `minecraft:glow_item_frame` that is invisible and empty._ +- `/trigger hide_frame` ~ _This hides the nearest `minecraft:item_frame` or `minecraft:glow_item_frame` within 1.5 blocks of the player._ +- `/trigger show_frame` ~ _This unhides the nearest `minecraft:item_frame` or `minecraft:glow_item_frame` within 1.5 blocks of the player._ + +## invstand +I will explain this feature when I successfully add it into the datapack. + + ## packauthor -This is should use the `tellraw` command to provide information on the datapack (author and load status) everytime the datapack is reloaded. This feature is curently bugged and does not work as intended. +This feature uses the `tellraw` command to provide information on the datapack everytime the datapack is reloaded. It also creates the following two `trigger` commands that people can use. +- `/trigger silence_alerts` ~ _This mutes the datapack alerts for individual features loading._ +- `/trigger enable_alerts` ~ _This unmutes the datapack alerts for individual features loading._ ## playerseats +This feature adds the ability to sit anywhere the player wants using the following `trigger` command. +- `/trigger sit` ~ _This makes the player sit in the location they were standing._ + +## pocketshulker I will explain this feature when I successfully add it into the datapack. + ## shearheads This feature adds the ability to collect a `minecraft:blocks/player_head` without having to kill the player in MJE. Eventualy this feature will extend to other mobs/entities as well, but in the meantime it remains for players only. > The items `minecraft:blocks/player_head` will not carry special properties that extend beyond the purpose of decorations. For example, collecting a wither skelleton head (in the future) will not give you a `minecraft:blocks/wither_skeleton_skull`. To collect the `minecraft:blocks/player_head` you will need to craft a special item useing the recipe found in `minecraft/recipe/god_reaper.json`. This is a shapeless recipe that consists of a `minecraft:armor_stand`, `minecraft:written_book`, and `minecraft:shears`. Once this item is aquired, simply walk up to the player you want the head from and hit them with this item. You must be within 2 blocks of them and they have to be in survival mode for this to work. This feature successfuly triggers only when the entitiy takes damage from the custom item and you are in the correct range. + +## silencetags +I will explain this feature when I successfully add it into the datapack. + \ No newline at end of file diff --git a/data/cleanup/function/loop.mcfunction b/data/cleanup/function/loop.mcfunction new file mode 100644 index 0000000..8e521a1 --- /dev/null +++ b/data/cleanup/function/loop.mcfunction @@ -0,0 +1,11 @@ +# ======= Clean Up ======= +# Add the logic of the trigger command for the cleanup function. +execute as @a[scores={clean_up=1..}] at @s run tp @e[type=minecraft:item, distance=..16] @s +# Play a sound so that the player knows it ran. +execute at @a[scores={clean_up=1..}] run playsound minecraft:entity.item.pickup player @a[distance=..30] ~ ~ ~ +# Reset adn enable the trigger. +execute as @a[scores={clean_up=1..}] run scoreboard players reset @s clean_up +scoreboard players enable @a clean_up + +# ======= Cleanup Loop ======= +schedule function cleanup:loop 0.25s append \ No newline at end of file diff --git a/data/cleanup/function/setup.mcfunction b/data/cleanup/function/setup.mcfunction new file mode 100644 index 0000000..6c94e82 --- /dev/null +++ b/data/cleanup/function/setup.mcfunction @@ -0,0 +1,5 @@ +# ======= Clean Up ======= +# Add trigger for players to run the cleanup function. +scoreboard objectives add clean_up trigger "Clean Up" +# Alert everyone that datapack loaded successfully. +tellraw @a[team=!no_alerts] {"text":"Cleanup function initialized successfully.", "color":"green", "italic":false} \ No newline at end of file diff --git a/data/invframe/function/loop.mcfunction b/data/invframe/function/loop.mcfunction new file mode 100644 index 0000000..367bf19 --- /dev/null +++ b/data/invframe/function/loop.mcfunction @@ -0,0 +1,35 @@ +# ======= Hide Frame ======= +# Hide and lock an invframe. +execute at @a[scores={hide_frame=1..}] run data modify entity @e[type=#invframe:invframe, distance=..1.5, limit=1, sort=nearest] Invisible set value 1b +execute at @a[scores={hide_frame=1..}] run data modify entity @e[type=#invframe:invframe, distance=..1.5, limit=1, sort=nearest] Fixed set value 1b +# Adds tag for easier manipulation of entities. +execute as @e[type=#invframe:invframe, nbt={Invisible: 1b}] run tag @s add invisible_entity +# Play a sound so that the player knows it ran. +execute as @a[scores={hide_frame=1..}] at @e[tag=invisible_entity] run playsound minecraft:entity.item.pickup block @a[distance=..16] ~ ~ ~ 5 0 0.5 +# Reset and enable the trigger. +execute as @a[scores={hide_frame=1..}] run scoreboard players reset @s hide_frame +scoreboard players enable @a hide_frame + +# ======= Show Frame ======= +# Show and unlock an invframe. +execute at @a[scores={show_frame=1..}] run data modify entity @e[type=#invframe:invframe, distance=..1.5, limit=1, sort=nearest] Invisible set value 0b +execute at @a[scores={show_frame=1..}] run data modify entity @e[type=#invframe:invframe, distance=..1.5, limit=1, sort=nearest] Fixed set value 0b +# Play a sound so that the player knows it ran. +execute as @a[scores={show_frame=1..}] at @e[tag=invisible_entity] run playsound minecraft:entity.item.pickup block @a[distance=..16] ~ ~ ~ 5 1 0.5 +# Remove tag for unrequired manipulation of entities. +execute as @e[type=#invframe:invframe, nbt={Invisible: 0b}] run tag @s remove invisible_entity +# Reset and enable the trigger. +execute as @a[scores={show_frame=1..}] run scoreboard players reset @s show_frame +scoreboard players enable @a show_frame + +# ======= Find Frame ======= +# Find an invisible item frame using the tag atribute. +execute as @a[scores={find_frame=1..}] at @e[tag=invisible_entity] run particle minecraft:glow ~ ~0.05 ~ +# Play a sound so that the player knows it ran. +execute as @a[scores={find_frame=1..}] at @e[tag=invisible_entity] run playsound minecraft:block.amethyst_block.step block @a[distance=..16] ~ ~ ~ 5 1 0.5 +# Reset and enable the trigger. +execute as @a[scores={find_frame=1..}] run scoreboard players reset @s find_frame +scoreboard players enable @a find_frame + +# ======= Invframe Loop ======= +schedule function invframe:loop 0.25s append \ No newline at end of file diff --git a/data/invframe/function/setup.mcfunction b/data/invframe/function/setup.mcfunction new file mode 100644 index 0000000..c2246b9 --- /dev/null +++ b/data/invframe/function/setup.mcfunction @@ -0,0 +1,8 @@ +# ======= Invisable Frames ======= +# Add trigger for players to run the cleanup function. +scoreboard objectives add hide_frame trigger "Hide Frame" +scoreboard objectives add show_frame trigger "Show Frame" +scoreboard objectives add find_frame trigger "Find Frame" +# scoreboard objectives add debug_frame trigger "Debug Frame" +# Alert everyone that datapack loaded successfully. +tellraw @a[team=!no_alerts] {"text":"Invframe function initialized successfully.", "color":"green", "italic":false} \ No newline at end of file diff --git a/data/invframe/tags/entity_type/invframe.json b/data/invframe/tags/entity_type/invframe.json new file mode 100644 index 0000000..06aa476 --- /dev/null +++ b/data/invframe/tags/entity_type/invframe.json @@ -0,0 +1,7 @@ +{ + "values": + [ + "minecraft:item_frame", + "minecraft:glow_item_frame" + ] +} diff --git a/data/invstand/function/loop.mcfunction b/data/invstand/function/loop.mcfunction new file mode 100644 index 0000000..ae34c32 --- /dev/null +++ b/data/invstand/function/loop.mcfunction @@ -0,0 +1 @@ +# effect give @e[nbt={Invisible: 1b}, distance=..16] minecraft:glowing 5 1 true diff --git a/data/playerseats/advancement/trigger_seat.json.json b/data/invstand/function/setup.mcfunction similarity index 100% rename from data/playerseats/advancement/trigger_seat.json.json rename to data/invstand/function/setup.mcfunction diff --git a/data/playerseats/advancement/trigger_seatkill.json.json b/data/invstand/tags/entity_type/invstand.json similarity index 100% rename from data/playerseats/advancement/trigger_seatkill.json.json rename to data/invstand/tags/entity_type/invstand.json diff --git a/data/minecraft/tags/function/load.json b/data/minecraft/tags/function/load.json index 80d3930..7064da1 100644 --- a/data/minecraft/tags/function/load.json +++ b/data/minecraft/tags/function/load.json @@ -2,7 +2,13 @@ "values": [ "packauthor:setup", + "packauthor:loop", + "cleanup:setup", + "cleanup:loop", + "invframe:setup", + "invframe:loop", "playerseats:setup", + "playerseats:loop", "shearheads:setup" ] } \ No newline at end of file diff --git a/data/minecraft/tags/function/tick.json b/data/minecraft/tags/function/tick.json new file mode 100644 index 0000000..03d0715 --- /dev/null +++ b/data/minecraft/tags/function/tick.json @@ -0,0 +1,3 @@ +{ + "values": [] +} \ No newline at end of file diff --git a/data/packauthor/function/loop.mcfunction b/data/packauthor/function/loop.mcfunction new file mode 100644 index 0000000..e0a24e0 --- /dev/null +++ b/data/packauthor/function/loop.mcfunction @@ -0,0 +1,20 @@ +# ======= Silence Alerts ======= +# Add the logic of the trigger command for the cleanup function. +execute as @a[scores={silence_alerts=1..}] at @s run team join no_alerts @s +# Play a sound so that the player knows it ran. +execute at @a[scores={silence_alerts=1..}] run playsound minecraft:particle.soul_escape player @a[scores={silence_alerts=1..}, distance=..30] ~ ~ ~ +# Reset and enable the trigger. +execute as @a[scores={silence_alerts=1..}] run scoreboard players reset @s silence_alerts +scoreboard players enable @a silence_alerts + +# ======= Enable Alerts ======= +# Add the logic of the trigger command for the cleanup function. +execute as @a[scores={enable_alerts=1..}] at @s run team leave @s +# Play a sound so that the player knows it ran. +execute at @a[scores={enable_alerts=1..}] run playsound minecraft:block.note_block.chime player @a[scores={enable_alerts=1..}, distance=..30] ~ ~ ~ +# Reset and enable the trigger. +execute as @a[scores={enable_alerts=1..}] run scoreboard players reset @s enable_alerts +scoreboard players enable @a enable_alerts + +# ======= Silence Alerts Loop ======= +schedule function packauthor:loop 0.25s append \ No newline at end of file diff --git a/data/packauthor/function/setup.mcfunction b/data/packauthor/function/setup.mcfunction index 6df0975..70d0aba 100644 --- a/data/packauthor/function/setup.mcfunction +++ b/data/packauthor/function/setup.mcfunction @@ -1,2 +1,10 @@ +# ======= Pack Info ======= +# Setup team no_alerts to silence extra alerts from pack reload. +team add no_alerts "Silence Alerts" +# Add triggers for players to toggle datapack alerts. +scoreboard objectives add silence_alerts trigger "Silence Alerts" +scoreboard objectives add enable_alerts trigger "Enable Alerts" +# Make a global sound on reload. +execute at @e[type=minecraft:player] run playsound minecraft:block.note_block.bell master @a ~ ~ ~ 0.5 0 0.5 # List the credits for the datapack on load or reload. -tellraw @a {"text":"This datapack was built by amcocan.", "color":"light_purple", "italic":false} \ No newline at end of file +tellraw @a [{"text":"\"", "color":"light_purple"},{"text":"Darkness Datapack", "color":"dark_gray"},{"text":"\" was built by amcocan.", "color":"light_purple"}] \ No newline at end of file diff --git a/data/playerseats/function/create_seat.mcfunction b/data/playerseats/function/create_seat.mcfunction deleted file mode 100644 index e69de29..0000000 diff --git a/data/playerseats/function/loop.mcfunction b/data/playerseats/function/loop.mcfunction new file mode 100644 index 0000000..3b20167 --- /dev/null +++ b/data/playerseats/function/loop.mcfunction @@ -0,0 +1,19 @@ +# ======= Create Seat ======= +# Create an interaction type entity at player's location with a tag of seat. +execute as @a[scores={sit=1..}] at @s run summon interaction ~ ~ ~ {Tags:["playerseats"],NoGravity:1b,width:0.5f,height:0f} +# Sit the player on the interaction type entity. +execute as @a[scores={sit=1..}] at @s run ride @s mount @e[tag=playerseats,distance=..1,limit=1,sort=nearest] +# Play a sound for sitting so that other players know this function ran. +execute as @a[scores={sit=1..}] at @e[tag=invisible_entity] run playsound minecraft:entity.strider.saddle player @a[distance=..16] ~ ~ ~ 1 1 0.5 + +# ======= Remove Seat ======= +# Remove the interaction entity created so that no entities are left behind. +execute at @e[tag=playerseats] as @e[tag=playerseats] unless entity @p[distance=..1] run kill @e[tag=playerseats, limit=1, distance=..0.1] + +# ======= Reset Score ======= +# Reset and enable the trigger. +execute as @a[scores={sit=1..}] run scoreboard players reset @s sit +scoreboard players enable @a sit + +# ======= Playerseats Loop ======= +schedule function playerseats:loop 0.25s append \ No newline at end of file diff --git a/data/playerseats/function/remove_seat.mcfunction b/data/playerseats/function/remove_seat.mcfunction deleted file mode 100644 index e69de29..0000000 diff --git a/data/playerseats/function/setup.mcfunction b/data/playerseats/function/setup.mcfunction new file mode 100644 index 0000000..03d9a66 --- /dev/null +++ b/data/playerseats/function/setup.mcfunction @@ -0,0 +1,5 @@ +# ======= Player Seats ======= +# Add trigger for players to run the cleaplayerseatsnup function. +scoreboard objectives add sit trigger "Sit" +# Alert everyone that datapack loaded successfully. +tellraw @a[team=!no_alerts] {"text":"Playerseats function initialized successfully.", "color":"green", "italic":false} \ No newline at end of file diff --git a/data/playerseats/function/setup.mcfunction.mcfunction b/data/playerseats/function/setup.mcfunction.mcfunction deleted file mode 100644 index d3de9dd..0000000 --- a/data/playerseats/function/setup.mcfunction.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# Revoke the advancement for initial baseline. - -# Remove any existing instances of seats. - -# Alert everyone that datapack loaded successfully. -tellraw @a {"text":"Playerseats function initialized successfully.", "color":"green", "italic":false} \ No newline at end of file diff --git a/data/shearheads/function/on_shear.mcfunction b/data/shearheads/function/on_shear.mcfunction index b23be88..e546a15 100644 --- a/data/shearheads/function/on_shear.mcfunction +++ b/data/shearheads/function/on_shear.mcfunction @@ -1,8 +1,7 @@ +# ======= Shear Heads ======= # Revoke advancment to allow you the chance of re-triggering. advancement revoke @s only shearheads:shear_player - # Detect shearing and check if the player using the shears is crouching execute as @e[type=player, distance=..2, limit=1, sort=furthest] run loot give @e[type=player, distance=..2, limit=1, sort=nearest] loot shearheads:blocks/sheared_head - # Make the noise for shearing to let player know this function ran. playsound block.beehive.shear player @a[distance=..30] ~ ~ ~ diff --git a/data/shearheads/function/setup.mcfunction b/data/shearheads/function/setup.mcfunction index 925df10..9771d6a 100644 --- a/data/shearheads/function/setup.mcfunction +++ b/data/shearheads/function/setup.mcfunction @@ -1,5 +1,5 @@ +# ======= Shear Heads ======= # Revoke the advancement for initial baseline. advancement revoke @a only shearheads:shear_player - # Alert everyone that datapack loaded successfully. -tellraw @a {"text":"Shearheads function initialized successfully.", "color":"green", "italic":false} \ No newline at end of file +tellraw @a[team=!no_alerts] {"text":"Shearheads function initialized successfully.", "color":"green", "italic":false} \ No newline at end of file