Ability to get the "exact" targeted block #5612
Labels
completed
The issue has been fully resolved and the change will be in the next Skript update.
enhancement
Feature request, an issue about something that could be improved, or a PR improving something.
good first issue
An issue that would be good for a first-time contributor to make a PR for
priority: lowest
"Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Suggestion
ExprTargetedBlock should be enhanced to support the
getTargetBlockExact
method as well.e.g.
[:exact] targeted block [of %players%]
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#getTargetBlockExact(int,org.bukkit.FluidCollisionMode)
Not sure how we would want to handle FluidCollisionMode
"Good First Issue" instructions:
To implement this, simply add a new parse tag to the pattern. A parse tag allows us to determine when a specific part of a pattern has been used. For example, given
[:exact] targeted block [of %players%]
, this pattern has a parse tag ("exact") for the "exact" part of the pattern (that's what the:
does). In the init method, one can checkparseResult.hasTag("exact")
to see if the user used that keyword. Then, the differentiation on what method to perform can be handled in the get method.Why?
The exact targeted block takes block forms into account, meaning users can get the block a user is looking at through the gap of some other block.
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: