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
Effect Command API Enhancement & Skript Event Support #6587
base: dev/feature
Are you sure you want to change the base?
Effect Command API Enhancement & Skript Event Support #6587
Conversation
# Conflicts: # src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the idea of adding more effect command things for scripts but I won't stop it from happening if everybody else approves.
else | ||
sender.sendMessage(ChatColor.RED + "Error in: " + ChatColor.GRAY + SkriptColor.replaceColorChar(command)); | ||
log.printErrors(sender, "(No specific information is available)"); | ||
sender.sendMessage(ChatColor.RED + "Your effect command '" + SkriptColor.replaceColorChar(command) + "' was cancelled."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These error messages probably ought to be lang entries, but it's okay if you feel that's out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeking for extended support of this in the skriptlang channel.
Description
This PR provides enhancements on how Effect Commands are handled, and adds Skript event support for users to listen to.
API Change: EffectCommandEvent
Currently, this event is only called whenever the parsed effect is valid. With this PR, the event is now called whenever an effect command attempt is done. The said event class now has a nullable
Effect
field to determine whether the parsed effect is valid. Due to this change,EffectCommandEvent#setCommand(String)
has been removed due to unavailable better alternative to retain this method whilst returning the parsed effect.Skript Event Support
With this PR, users are able to listen to EffectCommandEvent.
Event values:
Syntaxes:
[the] effect [command] is [not:(not |in)]valid
-- checks whether the parsed effect command in EffectCommandEvent is validTarget Minecraft Versions: any
Requirements: none
Related Issues: none