Any way to prevent spectator mode players from teleporting? [FABRIC]
Fairly niche, but I've got some players spectating an armor stand constantly, as to lock their camera. The issue, is they can teleport to any player using the hotbar, and while they're put back on the armor stand within a tick, they very briefly see the coords of the player they teleported to, which is an issue because this server is intended to have a focus on pvp, and I can't leak people's coords.
2 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by worstending#0
Not quite familiar with fabric, but usually all APIs (bukkit, forge, sponge..) have event handlers.
Since I see you are not a developer, but rather a server owner, you can try searching someone on Fiverr to do it for you, should be something easy. A basic definition would be: cancel the teleport event if for example player is a spectator and whatever you need. Be sure to make it so that it only cancels it when a spectator teleports on its own, otherwise, any teleport will be blocked.
If you want to do it yourself, you can search a basic tutorial on how to start a mod and add the event handler.