Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature QueryBlockNbt #419

Open
Miro-Andrin opened this issue May 11, 2021 · 2 comments
Open

Feature QueryBlockNbt #419

Miro-Andrin opened this issue May 11, 2021 · 2 comments

Comments

@Miro-Andrin
Copy link
Contributor

Feature Request

Implement rudimentary support for the QueryBlockNbt packet.

Description

Implement rudimentary support for the QueryBlockNbt request. When a player/client presses Shift+F3+I the overview specifies what block the players is looking at. This is done by sending this request to the server. The client specifies a xyz of a block it would like to query.

It is one of 33 packets in feather/server/src/packet_handlers.rs that are not handled.

Describe the solution you'd like

To implement this feature properly we would have to check for line of sight, else a hacked client could use this feature for x-ray and player radar. The minimal viable solution is to just check that the block in question is within a, lets say, 6 block radius of the caller.

Allowing a client to query any arbitrary position is probably a bad idea anyway, because timing of the response could tell if a chunk is loaded or not. Therefore we should never allow someone to call this on a position further away then max render distance.

The file feather/common/src/world.rs:122 has a function for querying the world about a block position. And it is accessible through the variable game.

@Miro-Andrin Miro-Andrin changed the title QueryBlockNbt Feature QueryBlockNbt May 11, 2021
@Miro-Andrin
Copy link
Contributor Author

I have twice noticed that people have tried implementing this feature but hit the same issue. The client appears to never send the packet, even if pressing Shift+F3+I. The current theory is that it has something to do with opt levels. I don't understand what the issue is, but for anyone interested here is a link to the last time it was mentioned in the discord.
https://discord.com/channels/619316022800809995/805342116057579520/890973148516843571

@Tracreed
Copy link
Contributor

The first problem is to even get the client to send the packet the client needs to be send a packet telling it that it's OP level >= 3,
There is also no concept of block NBT data yet. So that would have to be implemented to properly implement this.

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

No branches or pull requests

2 participants