Skip to content

Commit 5dbb6a4

Browse files
committed
1.21 Release
1 parent f06fa03 commit 5dbb6a4

36 files changed

Lines changed: 251 additions & 112 deletions

LICENSE.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 - 2100, Jodek
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
22+
23+
END OF LICENSE
24+
25+
---
26+
27+
Summary
28+
29+
Permissions
30+
- Commercial use
31+
- Distribution
32+
- Modification
33+
- Private use
34+
35+
Conditions
36+
- License and copyright notice
37+
38+
Limitations
39+
- Liability
40+
- Warranty

data/jodek/advancement/root.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"display": {
3+
"icon": {
4+
"id": "minecraft:player_head",
5+
"components": {
6+
"minecraft:profile": {
7+
"id": [
8+
-678894869,
9+
-1704640057,
10+
-1185339821,
11+
1705315599
12+
],
13+
"properties": [
14+
{
15+
"name": "textures",
16+
"value": "ewogICJ0aW1lc3RhbXAiIDogMTcxMTk4OTU4MDU2NCwKICAicHJvZmlsZUlkIiA6ICJkNzg4ZTJlYjlhNjU0MWM3Yjk1OTI2NTM2NWE1MGQwZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJKb2RlayIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9mZDIyZDNhMmI3NGY0ZDhlZDczMDg2NDk2NjM3NGMzMjYwOTg5ZGFhMTE4NWM1YTVkYTVhZjA2YzgwMmEyNmY3IgogICAgfSwKICAgICJDQVBFIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9mOWE3NjUzNzY0Nzk4OWY5YTBiNmQwMDFlMzIwZGFjNTkxYzM1OWU5ZTYxYTMxZjRjZTExYzg4ZjIwN2YwYWQ0IgogICAgfQogIH0KfQ=="
17+
}
18+
]
19+
}
20+
}
21+
},
22+
"title": "Jodeks Datapacks",
23+
"description": "https://modrinth.com/user/Jodek",
24+
"background": "minecraft:textures/block/gray_concrete.png",
25+
"frame": "challenge",
26+
"show_toast": false,
27+
"announce_to_chat": false
28+
},
29+
"criteria": {
30+
"tick": {
31+
"trigger": "minecraft:tick"
32+
}
33+
}
34+
}
35+
36+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"display": {
33
"icon": {
4-
"item": "minecraft:red_bed"
4+
"id": "minecraft:red_bed"
55
},
66
"title": "Sleep",
7-
"description": "Displays sleeping players and skips the night after some time",
7+
"description": "Displays sleeping players and skips the night if one player slept 5s",
88
"frame": "task",
99
"show_toast": false,
1010
"announce_to_chat": false
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"display": {
33
"icon": {
4-
"item": "minecraft:command_block_minecart"
4+
"id": "minecraft:command_block_minecart"
55
},
66
"title": "Utility",
7-
"description": "https://modrinth.com/collection/P5y8mJyI",
7+
"description": "modrinth.com/collection/P5y8mJyI",
88
"frame": "goal",
99
"show_toast": false,
1010
"announce_to_chat": false

data/jodek/advancements/root.json

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title @a actionbar ["Sleeping: ", {"selector":"@a[tag=sleeping]", "color": "yellow"}]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
tellraw @a ["",{"text":"Sleep","color":"blue","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}},{"text":" loaded - ","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}},{"text":"[1.21]","color":"green","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}},{"text":" ","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}},{"text":"v.2.3.1","color":"dark_green","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}}]
2+
3+
scoreboard objectives add sleep.time_since_rest custom:time_since_rest
4+
5+
scoreboard objectives add sleep.time_in_bed dummy
6+
7+
scoreboard objectives add sleep.total_speeping dummy
8+
9+
scoreboard objectives add sleep.clock dummy
10+
11+
12+
# disable gamerule
13+
gamerule playersSleepingPercentage 101
14+
15+
16+
# track how many players sleep
17+
scoreboard objectives add sleep.sleeping_players dummy
18+
19+
# track how many players are online
20+
scoreboard objectives add sleep.players_online dummy
21+
22+
23+
24+
# config
25+
# open config
26+
scoreboard objectives add sleep.config trigger
27+
28+
29+
30+
# set default values for sleep.config
31+
32+
33+
# time until skip
34+
execute as @a unless score &time_until_skip sleep.config = &time_until_skip sleep.config run scoreboard players set &time_until_skip sleep.config 2
35+
36+
# amount of players need to sleep
37+
execute as @a unless score &amount_to_sleep sleep.config = &amount_to_sleep sleep.config run scoreboard players set &amount_to_sleep sleep.config 1
38+
39+
# time skip or accelerated
40+
execute as @a unless score &time_control sleep.config = &time_control sleep.config run scoreboard players set &time_control sleep.config 0
41+
42+
# setting to disable phantoms
43+
# execute as @a unless score &phantoms_spawning sleep.config = &phantoms_spawning sleep.config run scoreboard players set &phantoms_spawning sleep.config 0
44+
# This is WIP
45+
46+
47+
# maybe setting if time to skip night should reset or not when one players gets out of bed
48+
49+
# setting to get command feedback
50+
51+
# skip night???
52+
53+
# notification settings
54+
scoreboard objectives add sleep_notification trigger
55+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# notifications
2+
execute as @a unless score @s sleep_notification = @s sleep_notification run scoreboard players set @s sleep_notification 0
3+
scoreboard players enable @a sleep_notification
4+
5+
execute as @a[scores={sleep_notification=1..}] at @s if score $global sleep.total_speeping matches 0 run function sleep:timeofday
6+
7+
8+
# How long does one player sleep
9+
scoreboard players set @a[scores={sleep.time_since_rest=1..}] sleep.time_in_bed 0
10+
execute if score &playerNum sleep.players_online < &amount_to_sleep sleep.config run scoreboard players add @a[scores={sleep.time_since_rest=0}] sleep.time_in_bed 1
11+
12+
# only count up time until night skip when everyone is in bed
13+
execute if score &sleep_amount sleep.sleeping_players >= &amount_to_sleep sleep.config run scoreboard players add @a[scores={sleep.time_since_rest=0}] sleep.time_in_bed 1
14+
15+
# reset time when one goes out of bed
16+
execute if score &playerNum sleep.players_online >= &amount_to_sleep sleep.config run execute if score &sleep_amount sleep.sleeping_players < &amount_to_sleep sleep.config run scoreboard players set @a[scores={sleep.time_since_rest=0}] sleep.time_in_bed 0
17+
18+
# How many players sleep
19+
execute store result score &sleep_amount sleep.sleeping_players if entity @a[tag=sleeping]
20+
21+
# time skip
22+
# check config + how many players sleep
23+
execute if score &sleep_amount sleep.sleeping_players = &amount_to_sleep sleep.config run function sleep:time_control/time_control
24+
25+
# actionbar with message + with 1 more has to sleep if theres any
26+
execute if entity @a[tag=sleeping] run function sleep:actionbar/main_actionbar
27+
28+
# check how many players --> if only 1 then skip when 1 sleeps
29+
execute store result score &playerNum sleep.players_online run list
30+
execute if score &playerNum sleep.players_online < &amount_to_sleep sleep.config if score &sleep_amount sleep.sleeping_players < &amount_to_sleep sleep.config run function sleep:time_control/time_control
31+
execute as @a[scores={sleep.time_in_bed=1..}] run execute if score &playerNum sleep.players_online < &amount_to_sleep sleep.config if score &sleep_amount sleep.sleeping_players < &amount_to_sleep sleep.config run function sleep:actionbar/main_actionbar
32+
33+
# add + remove sleeping tag
34+
tag @a remove sleeping
35+
execute as @a at @s positioned ~ ~0.3 ~ unless entity @s[dx=0] run tag @s add sleeping
36+
37+
38+
# config
39+
# scoreboard players enable @a sleep.config
40+
# execute as @a[scores={sleep.config=1..}] run function sleep:config/main_config
41+
42+
43+
44+
45+
# kill phantoms of nearby players who did sleep - maybe include in next update
46+
47+
48+
49+
50+

0 commit comments

Comments
 (0)