Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e8422cf
Updates the README.md file.
amcocan Nov 30, 2024
b5949d2
Writes functions for playerseats.
amcocan Nov 30, 2024
8dabff6
Changes reload order.
amcocan Nov 30, 2024
f3b4be8
Fixes file extention problem with playerseats:setup.
amcocan Nov 30, 2024
df9c5b9
Adds trigger_seat advancement & fixes file extention errors.
amcocan Nov 30, 2024
e5cf9e0
Attempts patch on advancement trigger.
amcocan Nov 30, 2024
ac85b4e
Attempts patch on advancement.
amcocan Nov 30, 2024
b3a341f
Attempts patch on advancement.
amcocan Nov 30, 2024
8059a7e
Attempts patch on advancement.
amcocan Nov 30, 2024
89c5d99
Updates packauthor:setup.
amcocan Nov 30, 2024
c25c676
Adds the ability to silence datapack reload alerts.
amcocan Nov 30, 2024
fab189b
Changes team name for no_alerts.
amcocan Nov 30, 2024
3a22eee
Adds cleanup function.
amcocan Dec 2, 2024
16d9deb
Fixes trigger order.
amcocan Dec 3, 2024
935230a
Atempts to patch trigger bug.
amcocan Dec 3, 2024
f47abca
Atempts patch on triggers.
amcocan Dec 3, 2024
79c7798
Tests trigger sound.
amcocan Dec 3, 2024
7a55bf6
Atempts patch for triggers.
amcocan Dec 3, 2024
d13166a
Patches trigger sound.
amcocan Dec 3, 2024
2d2157e
Patches trigger sound.
amcocan Dec 3, 2024
0d1f8fb
Patches trigger bug.
amcocan Dec 3, 2024
279e093
Patches trigger sound.
amcocan Dec 3, 2024
1058793
Adds enable_alerts trigger.
amcocan Dec 3, 2024
6bcb3cd
Fixes coding style and some quirks.
amcocan Dec 3, 2024
33a45f3
Adds datapack reload sound.
amcocan Dec 3, 2024
e15ae99
Increases cleanup range.
amcocan Dec 3, 2024
777f8b7
Updates README.md file.
amcocan Dec 3, 2024
abf188c
Addes invframe feature.
amcocan Dec 3, 2024
1efdfe5
Updates the effective distance for trigger.
amcocan Dec 3, 2024
19697bf
Patches invframe triggers.
amcocan Dec 3, 2024
9c410c5
Adds debug_frame trigger.
amcocan Dec 3, 2024
97c19c2
Patch debug_frame trigger.
amcocan Dec 3, 2024
7eef2f8
Removes debug_frame trigger and patches triggers.
amcocan Dec 4, 2024
2746f6e
Patches trigger.
amcocan Dec 4, 2024
68e882f
Atempts trigger patch.
amcocan Dec 4, 2024
b7e588d
Adds toggle for tag as separate function.
amcocan Dec 4, 2024
d0c2490
Attempts trigger patch.
amcocan Dec 4, 2024
9048673
Atempts trigger patch.
amcocan Dec 4, 2024
af99f5c
Atempts trigger patch.
amcocan Dec 4, 2024
0899cdc
Makes tag global.
amcocan Dec 4, 2024
bcf845e
Removes toggle_tag function.
amcocan Dec 4, 2024
7e51fd4
Optimizes the invframe function.
amcocan Dec 4, 2024
7e9dfc1
Optimizes the invframe function.
amcocan Dec 4, 2024
074f71a
Optimizes the datapack.
amcocan Dec 4, 2024
885e661
Presets invstand function.
amcocan Dec 4, 2024
6c2b926
Updates README.md file.
amcocan Dec 5, 2024
8426b20
Adds playerseats function.
amcocan Dec 7, 2024
97d5c2d
Updates README.md file.
amcocan Dec 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<!-- Creepers / Endermen / Ghasts / Withers - Selective Griefing Removal -->

## 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.
<!-- A way to toggle pvp. -->

## fastleafdecay
I will explain this feature when I successfully add it into the datapack.
<!-- Adds fast leaf decay for all trees. -->

## 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.
<!-- Invisible / Invulnerable / Locking - Armor Stands -->

## 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.
<!-- Opening shulkers in inventory. -->

## 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.
<!-- Add name tags that silence mobs permanently. -->
11 changes: 11 additions & 0 deletions data/cleanup/function/loop.mcfunction
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions data/cleanup/function/setup.mcfunction
Original file line number Diff line number Diff line change
@@ -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}
35 changes: 35 additions & 0 deletions data/invframe/function/loop.mcfunction
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions data/invframe/function/setup.mcfunction
Original file line number Diff line number Diff line change
@@ -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}
7 changes: 7 additions & 0 deletions data/invframe/tags/entity_type/invframe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values":
[
"minecraft:item_frame",
"minecraft:glow_item_frame"
]
}
1 change: 1 addition & 0 deletions data/invstand/function/loop.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# effect give @e[nbt={Invisible: 1b}, distance=..16] minecraft:glowing 5 1 true
6 changes: 6 additions & 0 deletions data/minecraft/tags/function/load.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"values":
[
"packauthor:setup",
"packauthor:loop",
"cleanup:setup",
"cleanup:loop",
"invframe:setup",
"invframe:loop",
"playerseats:setup",
"playerseats:loop",
"shearheads:setup"
]
}
3 changes: 3 additions & 0 deletions data/minecraft/tags/function/tick.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}
20 changes: 20 additions & 0 deletions data/packauthor/function/loop.mcfunction
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion data/packauthor/function/setup.mcfunction
Original file line number Diff line number Diff line change
@@ -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}
tellraw @a [{"text":"\"", "color":"light_purple"},{"text":"Darkness Datapack", "color":"dark_gray"},{"text":"\" was built by amcocan.", "color":"light_purple"}]
Empty file.
19 changes: 19 additions & 0 deletions data/playerseats/function/loop.mcfunction
Original file line number Diff line number Diff line change
@@ -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
Empty file.
5 changes: 5 additions & 0 deletions data/playerseats/function/setup.mcfunction
Original file line number Diff line number Diff line change
@@ -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}
6 changes: 0 additions & 6 deletions data/playerseats/function/setup.mcfunction.mcfunction

This file was deleted.

3 changes: 1 addition & 2 deletions data/shearheads/function/on_shear.mcfunction
Original file line number Diff line number Diff line change
@@ -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] ~ ~ ~
4 changes: 2 additions & 2 deletions data/shearheads/function/setup.mcfunction
Original file line number Diff line number Diff line change
@@ -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}
tellraw @a[team=!no_alerts] {"text":"Shearheads function initialized successfully.", "color":"green", "italic":false}