Skip to content

Commit 3c3ad9b

Browse files
committed
1.20.1 Release
1 parent f06fa03 commit 3c3ad9b

23 files changed

Lines changed: 338 additions & 59 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/advancements/root.json

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,30 @@
44
"item": "minecraft:player_head",
55
"nbt": "{SkullOwner: {Id: [I; -678894869, -1704640057, -1185339821, 1705315599], Properties: {textures: [{Value: \"ewogICJ0aW1lc3RhbXAiIDogMTcxMTk4OTU4MDU2NCwKICAicHJvZmlsZUlkIiA6ICJkNzg4ZTJlYjlhNjU0MWM3Yjk1OTI2NTM2NWE1MGQwZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJKb2RlayIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9mZDIyZDNhMmI3NGY0ZDhlZDczMDg2NDk2NjM3NGMzMjYwOTg5ZGFhMTE4NWM1YTVkYTVhZjA2YzgwMmEyNmY3IgogICAgfSwKICAgICJDQVBFIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9mOWE3NjUzNzY0Nzk4OWY5YTBiNmQwMDFlMzIwZGFjNTkxYzM1OWU5ZTYxYTMxZjRjZTExYzg4ZjIwN2YwYWQ0IgogICAgfQogIH0KfQ==\"}]}}}"
66
},
7-
"title": "Jodeks Datapacks",
8-
"description": "https://modrinth.com/user/Jodek",
9-
"background": "minecraft:textures/block/gray_concrete.png",
7+
"title": "Jodeks Datapacks ",
8+
"description": [
9+
"",
10+
{
11+
"text": "Creator of vanilla friendly datapacks\n",
12+
"color": "white"
13+
},
14+
{
15+
"text": "\n",
16+
"color": "white"
17+
},
18+
{
19+
"text": "modrinth.com/user/Jodek",
20+
"color": "dark_purple"
21+
}
22+
],
23+
"background": "minecraft:textures/block/flowering_azalea_leaves.png",
1024
"frame": "challenge",
1125
"show_toast": false,
1226
"announce_to_chat": false
13-
},
14-
"criteria": {
27+
},
28+
"criteria": {
1529
"tick": {
16-
"trigger": "minecraft:tick"
30+
"trigger": "minecraft:tick"
1731
}
32+
}
1833
}
19-
}

data/jodek/advancements/sleep.json

Lines changed: 75 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,76 @@
11
{
2-
"display": {
3-
"icon": {
4-
"item": "minecraft:red_bed"
5-
},
6-
"title": "Sleep",
7-
"description": "Displays sleeping players and skips the night after some time",
8-
"frame": "task",
9-
"show_toast": false,
10-
"announce_to_chat": false
11-
},
12-
"parent": "jodek:utility",
13-
"criteria": {
14-
"tick": {
15-
"trigger": "minecraft:tick"
16-
}
17-
}
18-
}
2+
"display": {
3+
"icon": {
4+
"item": "minecraft:red_bed"
5+
},
6+
"title": "Sleep ",
7+
"description": [
8+
"",
9+
{
10+
"text": "Simple Multiplayer Sleep\n",
11+
"color": "white"
12+
},
13+
{
14+
"text": "\n",
15+
"color": "yellow"
16+
},
17+
{
18+
"text": "/trigger",
19+
"color": "yellow"
20+
},
21+
{
22+
"text": " help.sleep\n",
23+
"color": "yellow"
24+
},
25+
{
26+
"text": "for help\n",
27+
"color": "white"
28+
},
29+
{
30+
"text": "\n",
31+
"color": "green"
32+
},
33+
{
34+
"text": "Datapack version: ",
35+
"color": "dark_green"
36+
},
37+
{
38+
"text": "v.2.0.0",
39+
"color": "green"
40+
},
41+
{
42+
"text": "\n",
43+
"color": "green"
44+
},
45+
{
46+
"text": "Game version: ",
47+
"color": "dark_green"
48+
},
49+
{
50+
"text": "1.20.1",
51+
"color": "green"
52+
},
53+
{
54+
"text": "\n",
55+
"color": "green"
56+
},
57+
{
58+
"text": "\n",
59+
"color": "green"
60+
},
61+
{
62+
"text": "modrinth.com/datapack/sleep",
63+
"color": "dark_purple"
64+
}
65+
],
66+
"frame": "task",
67+
"show_toast": false,
68+
"announce_to_chat": false
69+
},
70+
"parent": "jodek:utility",
71+
"criteria": {
72+
"tick": {
73+
"trigger": "minecraft:tick"
74+
}
75+
}
76+
}
Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
{
2-
"display": {
3-
"icon": {
4-
"item": "minecraft:command_block_minecart"
5-
},
6-
"title": "Utility",
7-
"description": "https://modrinth.com/collection/P5y8mJyI",
8-
"frame": "goal",
9-
"show_toast": false,
10-
"announce_to_chat": false
11-
},
12-
"parent": "jodek:root",
13-
"criteria": {
14-
"tick": {
15-
"trigger": "minecraft:tick"
16-
}
17-
}
18-
}
2+
"display": {
3+
"icon": {
4+
"item": "minecraft:command_block_minecart"
5+
},
6+
"title": "Utility ",
7+
"description": [
8+
"",
9+
{
10+
"text": "Utility collection of my datapacks\n",
11+
"color": "white"
12+
},
13+
{
14+
"text": "\n",
15+
"color": "white"
16+
},
17+
{
18+
"text": "modrinth.com/collection/P5y8mJyI",
19+
"color": "dark_purple"
20+
}
21+
],
22+
"frame": "goal",
23+
"show_toast": false,
24+
"announce_to_chat": false
25+
},
26+
"parent": "jodek:root",
27+
"criteria": {
28+
"tick": {
29+
"trigger": "minecraft:tick"
30+
}
31+
}
32+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"values": [
3-
"sleep:main"
4-
]
3+
"sleep:main"
4+
]
55
}
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: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,57 @@
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.20.4]","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.0.2.0","color":"dark_green","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}}]
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.20.1]","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.0.0","color":"dark_green","clickEvent":{"action":"open_url","value":"https://modrinth.com/datapack/sleep/"},"hoverEvent":{"action":"show_text","contents":"modrinth.com/datapack/sleep/"}}]
2+
23
scoreboard objectives add sleep.time_since_rest custom:time_since_rest
34

45
scoreboard objectives add sleep.time_in_bed dummy
56

67
scoreboard objectives add sleep.total_speeping dummy
78

8-
99
scoreboard objectives add sleep.clock dummy
1010

1111

12-
scoreboard objectives add sleep_notification trigger
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 dummy
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+
56+
scoreboard objectives add help.sleep trigger
57+
Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,52 @@
1+
# notifications
12
execute as @a unless score @s sleep_notification = @s sleep_notification run scoreboard players set @s sleep_notification 0
23
scoreboard players enable @a sleep_notification
34

5+
execute as @a[scores={sleep_notification=1..}] at @s if score $global sleep.total_speeping matches 0 run function sleep:timeofday
6+
7+
48
# How long does one player sleep
59
scoreboard players set @a[scores={sleep.time_since_rest=1..}] sleep.time_in_bed 0
6-
scoreboard players add @a[scores={sleep.time_since_rest=0}] sleep.time_in_bed 1
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
717

818
# How many players sleep
9-
execute store result score $global sleep.total_speeping run data get storage sleep:sleep players_sleeping
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+
1044

11-
execute if score $global sleep.total_speeping matches 1 run function sleep:titles/one_player_sleeping
12-
execute if score $global sleep.total_speeping matches 2 run function sleep:titles/two_players_sleeping
13-
execute if score $global sleep.total_speeping matches 3.. run function sleep:titles/thee_or_more_sleeping
45+
# kill phantoms of nearby players who did sleep - maybe include in next update
1446

15-
execute as @a[scores={sleep.time_in_bed=1..}, tag=!sleep.sleeping] run function sleep:bed/get_in
16-
execute as @a[scores={sleep.time_in_bed=0}, tag=sleep.sleeping] run function sleep:bed/get_out
1747

18-
execute as @a[scores={sleep.time_in_bed=100..}] run time set 0
1948

20-
execute as @a[scores={sleep_notification=1..}] if score $global sleep.total_speeping matches 0 run function sleep:timeofday
49+
scoreboard players enable @a help.sleep
2150

51+
execute as @a if score @s help.sleep matches 1 run function sleep:trigger_help
2252

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
execute if score &time_until_skip sleep.config matches 1 run function sleep:time_control/time_accelerate/2seconds
2+
3+
execute if score &time_until_skip sleep.config matches 2 run function sleep:time_control/time_accelerate/5seconds
4+
5+
execute if score &time_until_skip sleep.config matches 3 run function sleep:time_control/time_accelerate/10seconds
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
time add 42

0 commit comments

Comments
 (0)