Skript
Skript copied to clipboard
Adds spectator start/stop/swap Paper events and spectator target event value expression
Description
Note to those that are reviewing that there are plenty of logical mathematical statements, so this will take some time.
- Adds paper spectator events.
[on] [player] stop spectating [(of|from) %-*entitydatas%]
[on] [player] start spectating [of %-*entitydatas%]
[on] [player] (swap|switch) spectating [(of|from) %-*entitydatas%]
- Turns the ExprSpectatorTarget into an optional event value expression
spectator targetwhen using Paper. - Also has time state support as Paper can grab before and after spectator targets.
- Added documentation annotations to the class, as the original direct commit forgot to add them. #1346
- Adds support for multiple events from
SimpleExpression#setTime(int, Class<? extends Event>)toSimpleExpression#setTime(int, Class<? extends Event>...) - Fixes a bug where
SimpleExpression#setTime(int, Expression<?>, Class<? extends Event>...)would throw an error if the default expression was null. Made it throw a SkriptAPIException because it's a developer issue if they're definingspectator target [of %-players%]with a nullable expression and not a default expression.
Target Minecraft Versions: any Requirements: Paper