Target entity of player returns nothing if player's pitch is negative
4L0N50asd opened this issue · 3 comments
Skript/Server Version
[01:59:28 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[01:59:28 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[01:59:28 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[01:59:28 INFO]: [Skript] Server Version: git-Paper-496 (MC: 1.20.4)
[01:59:28 INFO]: [Skript] Skript Version: 2.8.5 (skriptlang-github)
[01:59:28 INFO]: [Skript] Installed Skript Addons: None
[01:59:28 INFO]: [Skript] Installed dependencies: None
Bug Description
Skript is returning nothing when using player's target entity
/ targeted entity
if the player's altitude is lower than the target entity / player's pitch is negative
This worked fine before 2.8.0 update #6157, where one of the changes were "The target entity of player expression has been improved and now uses raytracing to find the player's target."
From 2.8.0 pre-1 version until now (2.9.0-beta1) target entity
expression is returning nothing if you use it from a lower altitude than the target entity.
Tested versions: 2.8.0 pre-1, 2.8.0 pre-2, 2.8.0, 2.8.5, 2.9.0-beta1
Here is a proof https://youtu.be/4QxiDBRWW3E
Expected Behavior
Return the target entity whatever the angle of the player is
Steps to Reproduce
1- Install Skript 2.8.5 in latest Paper 1.20.4 (git-Paper-496 (MC: 1.20.4))
2- Summon any entity
3- Use any code that triggers target entity of player
4- Send the result of targeted entity
(or kill the entity, do whatever) to see if Skript is grabbing the target entity or not
5- Trigger the code at a location > 1 meter above the test entity
6- Now try again from a location < 2 meters below the test entity
7- You should see that Skript is not getting the target entity if you're in a lower altitude than the test entity (or maybe is it for the player's pitch value, being ~0 or lower)
on left click with a golden hoe:
send target entity to the player
kill target entity
Errors or Screenshots
No errors in code, no errors in console, no errors in chat
Proof already given in Bug description, but i share it again
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
Do you have a block in the way? If so you need to use target entity of player ignoring blcoks
There are no blocks in the way. I tested it with a floating rabbit 5 meters above the floor, so i'm 100% sure there is nothing between me and the rabbit, as you can see the video.
But, without blocks in all the way, target entity of player ignoring blocks
worked, so it's confusing but fine that there's an alternative. Also this will still be an issue if i want to get the target entity without ignoring blocks (and being in a lower altitude than the target entity)
Thank you ^^
I thought i caught all the bugs in that pr but i guess i missed yet another one (ah it was added after i approved lol). The author forgot to run a raycast if it's not ignoring blocks AND there's no block within range (default 100 blocks). That range thing is why you're mistaking it for a pitch/altitude bug, when you look at the sky there's no blocks within 100 meters in that direction.
you are correct about #6157 causing it