Minecraft Data Packs / Quality of Life

Survival Friendly Spectator (Multiplayer/Singleplayer)

  • check_circle Functions
  • check_circle Loot Tables
  • 31,291 views, 15 today
  • 6,087 downloads, 1 today
  • 81
  • 82
  • 58
sandwichentity's Avatar sandwichentity
Level 38 : Artisan Miner
11
This data pack enables all players, regardless of their operator role on a server, to enter spectator mode. Once a player finishes using spectator mode, they are automatically returned to their previous game mode, location, and dimension.

Spectator mode cannot be entered whilst a player is burning, suffocating, drowning, falling/flying, starving, poisoned, withering away or near hostile mobs and some angered neutral mobs, so it cannot be used to cheat death. These restrictions don't apply for any players in creative mode. See the preview video for examples.

Ideal for small survival servers, it accommodates up to ten players using spectator mode simultaneously. Each player is individually teleported back to their respective previous locations upon exiting spectator mode. While in spectator mode, all normal features, such as teleporting to other players via the hot bar, remain available.

By default, players receive night vision while in spectator mode, but this can be toggled on/off for each player. Additionally, a title and server-wide announcement are displayed when a player enters or exits spectator mode; operators can toggle this feature on/off.


Please leave a comment for older game version downloads, current download is for 1.20.4.

Commands:
/trigger spectator  (Toggles between spectator/survival mode)

/trigger spnightvis  (Toggles night vision in spectator mode on/off per player)



/execute as username run trigger spectator  (Toggles a specified player in/out of spectator mode)

/data modify storage spectator:stoptext 0 set value true  (Disables titles and serverwide announcements globally)

/data remove storage spectator:stoptext 0  (Enables titles and serverwide announcements globally)


/function spectator:reset  (Runs reset function)
CreditSpecial thanks to everyone in the comments who has given suggestions!
CompatibilityMinecraft 1.19
toMinecraft 1.20
Tags

9 Update Logs

Update #9 : by sandwichentity 01/10/2024 3:37:10 pmJan 10th

Update Notes:

- Fixed bug caused by grass being renamed to short_grass.
- Removed some redundant blocks from #intangibles.
LOAD MORE LOGS

Create an account or sign in to comment.

01/06/2024 1:04 pm
This reply was removed by the poster or a moderator.
01/10/2024 3:34 pm
This reply was removed by the poster or a moderator.
Cryolenced
01/05/2024 7:55 am
Level 1 : New Miner
Cryolenced's Avatar
idk if its just mine but 1.20.4 has a bug where it reads the player inside a block even if the player is freely open.
2
sandwichentity
01/10/2024 3:34 pm
Level 38 : Artisan Miner
sandwichentity's Avatar
Just uploaded new version, hopefully that's fixed it but let me know if it's still happening
1
Beastcookie_69
05/10/2024 6:05 am
Level 1 : New Miner
Beastcookie_69's Avatar
Using it on my 1.20.1 server still getting the same error :(
1
11/05/2023 9:43 pm
This reply was removed by the poster or a moderator.
11/06/2023 8:26 am
This reply was removed by the poster or a moderator.
Kawsiphek
06/17/2023 11:00 pm
Level 1 : New Explorer
history
Kawsiphek's Avatar
To get this running in 1.20.1: Open 'exit_spectator.mcfuntion' and delete these three lines:
execute as @a[scores={spectator=1..},nbt={previousPlayerGameType:0}] run gamemode survival
execute as @a[scores={spectator=1..},nbt={previousPlayerGameType:1}] run gamemode creative
execute as @a[scores={spectator=1..},nbt={previousPlayerGameType:2}] run gamemode adventure
and add this line instead:
execute as @a[scores={spectator=1..}] run gamemode survival

this breaks any functionality of being returned back to creative or adventure mode, but im not sure why you would need that anyway. The nbt tag "previousPlayerGameType" does not exist any more.

To fix the armor stand displaying the player name: Any instance of "Text1" on the 'slotX.mcfunction' files needs to be replaced with with "front_text.messages[0]"



thanks for the great plugin btw!
2
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome