1
0
Fork 0

Inital commit

This commit is contained in:
abtmtr 2025-08-27 20:49:18 -05:00
commit b5089257c5
1005 changed files with 23476 additions and 0 deletions

View file

@ -0,0 +1,6 @@
{
"values": [
"spectator_night_vision:load",
"spectator_night_vision:tick"
]
}

View file

@ -0,0 +1,9 @@
# Desc: Sets player into normal state
#
# Called by: spectator_night_vision:tick
effect clear @s night_vision
scoreboard players set @s snv_toggle -1
tellraw @s {"text":"Night Vision toggled off due to gamemode change.","color":"red"}
tag @s remove has_night_vision
tag @s add switched_gamemode

View file

@ -0,0 +1,9 @@
# Desc: Initializes all scores within the datapack
#
# Called by: main:tick
scoreboard objectives add night_vision trigger "toggle §enight vision§r for §espectator§r"
# Toggle
scoreboard objectives add snv_toggle dummy
scoreboard players set snv_toggle snv_toggle -1

View file

@ -0,0 +1,30 @@
# Desc: All commands here run every tick
#
# Called by: main:tick
schedule function spectator_night_vision:tick 1t
# Initialise players
# Scores → 0
scoreboard players add @a night_vision 0
scoreboard players add @a snv_toggle 0
# Set toggle to -1
scoreboard players set @a[scores={snv_toggle=0}] snv_toggle -1
# Enable trigger
scoreboard players enable @a night_vision
# Handle gamemode change
execute as @a[gamemode=!spectator,tag=has_night_vision] at @s run function spectator_night_vision:gamemode_change
# Track player initiating toggle
execute as @a[scores={night_vision=1..}] at @s run tag @s add snv_toggle
execute as @a[scores={night_vision=..-1}] at @s run tag @s add snv_toggle
# Toggle
execute as @a[tag=snv_toggle,gamemode=spectator] at @s[tag=!switched_gamemode] run function spectator_night_vision:toggle
execute as @a[tag=snv_toggle,gamemode=!spectator] at @s[tag=!switched_gamemode] run tellraw @s {"text": "You may only use that in spectator mode!", "color":"red"}
# Reset
scoreboard players set @a[tag=snv_toggle] night_vision 0
tag @a[tag=snv_toggle] remove snv_toggle
tag @a[tag=switched_gamemode] remove switched_gamemode

View file

@ -0,0 +1,18 @@
# Desc: Toggles night vision on/off based on toggle value
#
# Called by: spectator_night_vision:tick
# Multiply by -1 to invert
scoreboard players operation @s snv_toggle *= snv_toggle snv_toggle
# Tag
tag @s[scores={snv_toggle=1}] add has_night_vision
tag @s[scores={snv_toggle=-1}] remove has_night_vision
# Apply night vision
effect give @s[scores={snv_toggle=1}] night_vision 1000000 99 true
effect clear @s[scores={snv_toggle=-1}] night_vision
# Tellraw
tellraw @s[scores={snv_toggle=1}] {"text":"Night Vision toggled on.","color":"yellow"}
tellraw @s[scores={snv_toggle=-1}] {"text":"Night Vision toggled off.","color":"yellow"}

View file

@ -0,0 +1,8 @@
# Desc: Removes all scores within the datapack
#
# Called by: main:uninstall_message
schedule clear spectator_night_vision:tick
scoreboard objectives remove night_vision
scoreboard objectives remove snv_toggle

View file

@ -0,0 +1,38 @@
{
"display": {
"icon": {
"id": "minecraft:player_head",
"components": {
"minecraft:profile": {
"properties": [
{
"name": "textures",
"value": "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTg1YzMzNWM1MjVjZGFkY2Q4MmU4MDA4MzU1N2M2OTYzMGRmYjlhMWVkZjU5OTc0YzdmNjU4ZGI1MWEwYTFkOSJ9fX0="
}
]
}
}
},
"title": "Vanilla Tweaks",
"frame": "challenge",
"description": [
"",
{
"text": "All loaded Vanilla Tweaks data packs\n",
"color": "gold"
},
{
"text": "vanillatweaks.net",
"color": "yellow"
}
],
"background": "minecraft:textures/block/black_concrete.png",
"show_toast": false,
"announce_to_chat": false
},
"criteria": {
"tick": {
"trigger": "minecraft:tick"
}
}
}

View file

@ -0,0 +1,38 @@
{
"display": {
"icon": {
"id": "minecraft:potion",
"components": {
"minecraft:potion_contents": "minecraft:night_vision"
}
},
"title": "Spectator Night Vision",
"description": [
"",
{
"text": "Easily toggle night vision when in spectator.\n",
"color": "gold"
},
{
"text": "Enter",
"color": "green"
},
{
"text": " ",
"color": "gold"
},
{
"text": "/trigger night_vision",
"color": "yellow"
}
],
"show_toast": false,
"announce_to_chat": false
},
"parent": "vanillatweaks:root",
"criteria": {
"tick": {
"trigger": "minecraft:tick"
}
}
}

View file

@ -0,0 +1,5 @@
{
"values": [
"spectator_night_vision:uninstall"
]
}

View file

@ -0,0 +1,38 @@
{
"display": {
"icon": {
"id": "minecraft:player_head",
"components": {
"minecraft:profile": {
"properties": [
{
"name": "textures",
"value": "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTg1YzMzNWM1MjVjZGFkY2Q4MmU4MDA4MzU1N2M2OTYzMGRmYjlhMWVkZjU5OTc0YzdmNjU4ZGI1MWEwYTFkOSJ9fX0="
}
]
}
}
},
"title": "Vanilla Tweaks",
"frame": "challenge",
"description": [
"",
{
"text": "All loaded Vanilla Tweaks data packs\n",
"color": "gold"
},
{
"text": "vanillatweaks.net",
"color": "yellow"
}
],
"background": "minecraft:block/black_concrete",
"show_toast": false,
"announce_to_chat": false
},
"criteria": {
"tick": {
"trigger": "minecraft:tick"
}
}
}

View file

@ -0,0 +1,30 @@
{
"pack": {
"pack_format": 48,
"supported_formats": {
"min_inclusive": 48,
"max_inclusive": 80
},
"description": [
{
"text": "Spectator Night Vision",
"color": "gold"
},
{
"text": "\nvanillatweaks.net",
"color": "yellow"
}
]
},
"overlays": {
"entries": [
{
"formats": {
"min_inclusive": 71,
"max_inclusive": 2147483647
},
"directory": "overlay_71"
}
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB