Add pick API#10215
Conversation
|
Having this on a I'd say this better to be abstracted as an interface with |
I'm a bit confused? This doesn't related to picking up items/arrows - it's related to 'picking' entities, such as when you middle click to obtain a spawn egg or attack an entity. |
Should this be mentioned in the JavaDocs then? I actually don't know if it should, all I can say that I was confused about the exact functionality too so it might be something to think about. |
Oh, sorry, I don't really know the internals. But honestly, then it sounds even more confusing. Even though NMS uses "pick", I think there should be a better term/wording for this, and javadocs are clearly.. unclear of what exactly the parameter is. |
|
Attempted to clarify the javadocs a bit more. |
|
What is the API usecase for this here ? Just exposing internals for the sake if exposing seems meh, especially with such a weird concept like the "pickable" mojang fields. |
|
Personally, was trying to to get the entities within a player's line of sight that they could potentially hit. Referenced vanilla code and it used these values, so wrote this PR to expose them. |
|
Discussing this in voice,
regarding the range, this is generally not a range, this is basically just a "hit box inflation scale" value |
|
I think in general, this needs another name, its super confusing right now |
acc9556 to
724e561
Compare
|
Renamed |
|
Given we have 0 idea what the mojang defined concept behind this is, exposing it as API is a meh thing. I can see the reason you want it, but I think this would best live in UnsafeValues. Please move this to UnsafeValues and have them take the Entity instance as param instead. |
Adds API to get if an entity is pickable, as well as its pick radius.