Skip to content

Add permission to disallow spectators teleporting to players - #1729

Merged
granny merged 29 commits into
PurpurMC:ver/26.2from
Mickey42302:spectatetp
Jul 27, 2026
Merged

Add permission to disallow spectators teleporting to players#1729
granny merged 29 commits into
PurpurMC:ver/26.2from
Mickey42302:spectatetp

Conversation

@Mickey42302

Copy link
Copy Markdown
Contributor

I would like to suggest the addition of a "minecraft.spectatetp" permission node. It would allow for control over whether or not people can teleport to others in Spectator mode.

This idea originates from BasicLandMC: https://github.com/Basic-Land/BasicLandMC/blob/6936acca0bd195f762e9c09e8899d382eacd0c12/basiclandmc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch

@bobhenl

This comment was marked as spam.

@LuanBertozzi7 LuanBertozzi7 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good code🚀

@katekerllenevich

Copy link
Copy Markdown
Member

Please add a configuration option that would enable the requirement of this permission. We avoid making any changes that would automatically change any behavior from Paper.

@Mickey42302

Copy link
Copy Markdown
Contributor Author

I'll update the code. Does "spectator-teleport-permission" sound like an appropriate name for the configuration setting?

@ghost

ghost commented Feb 22, 2026

Copy link
Copy Markdown

"require-spectator-teleport-permission" sounds better to understand in my opinion

@katekerllenevich

Copy link
Copy Markdown
Member

"require-spectator-teleport-permission" sounds better to understand in my opinion

This is what I would go with as well.

@Mickey42302

Copy link
Copy Markdown
Contributor Author

I've added a configuration entry for the permission node. It is set to "false" by default.

Are any other changes needed? I apologise for the delay as well. I have a lot going on in real life.

@Mickey42302

Copy link
Copy Markdown
Contributor Author

I'm going to update the patches to make them work with Java Edition 26.2. This might take a bit.

@Mickey42302
Mickey42302 changed the base branch from ver/1.21.10 to ver/26.2 July 1, 2026 16:11

@granny granny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad idea, just some requested changes.

If you register the permission in the PurpurPermissions class in the registerPermissions() method as default true, you can avoid needing to specify a config option for this permission.

Please include a PR to PurpurDocs in the permissions page, and for the config option if we decide to keep it.

Comment thread purpur-server/minecraft-patches/features/0022-Add-spectatetp-permission.patch Outdated
Comment thread purpur-server/minecraft-patches/features/0022-Add-spectatetp-permission.patch Outdated
Comment thread purpur-server/minecraft-patches/features/0022-Add-spectatetp-permission.patch Outdated
@Mickey42302

Copy link
Copy Markdown
Contributor Author

I updated the code. Before I submit a pull request to the PurpurDocs repository, I'd like to ask if this is what you're looking for?

@djohts

djohts commented Jul 20, 2026

Copy link
Copy Markdown

I updated the code. Before I submit a pull request to the PurpurDocs repository, I'd like to ask if this is what you're looking for?

pretty sure granny meant to modify the existing patch instead of adding another one on top of it that "makes code less noisy"

@kacimiamine

Copy link
Copy Markdown
Contributor

Yeah those patches are really wrong. You should update the current patch you did, the 0022- patch and make it less noisy (simpler and shorter)

@Mickey42302

Copy link
Copy Markdown
Contributor Author

Is this better?

@Mickey42302

Copy link
Copy Markdown
Contributor Author

The comments are updated now.

@granny granny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has been sitting around long enough that I feel bad continuing to leave reviews to make this more maintainable. I've gone ahead and made my own changes and separated them into multiple commits to hopefully help guide you in any future PRs you make to this project. Mickey42302/Purpur@5e4d1b3...cd02f60

Thank you for this PR! I'll document the new permission in PurpurDocs myself as well.

@granny granny changed the title Add "minecraft.spectatetp". Add permission to disallow spectators teleporting to players Jul 27, 2026
@granny
granny merged commit 699be4e into PurpurMC:ver/26.2 Jul 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants