Skip to content
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

Support CommandHelper Scripts as well as Depenizen #22

Closed
TomLewis opened this issue Aug 18, 2024 · 3 comments
Closed

Support CommandHelper Scripts as well as Depenizen #22

TomLewis opened this issue Aug 18, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@TomLewis
Copy link

I saw this;
DenizenScript/Depenizen#430

Ive been using custom scripts for a very long time with brews, but ive been limited to running a command when brews drunk.
If you can make a commandHelper addon then you can hook directly into commandhelper/commadhelper directly into brewing which would be brilliant.

The feature I want, is to prevent drinking the brew if the script returns false.

For exmaple, I have a "Super chorus" brew that I make run a random teleport plugins commands, BUT i needed to make it check if the player was PvP tagged first, I got it all working, but it still consumes the brew, the only idea ive had to resolve this is in the script give them another brew, but then it wont be able to know how strong etc.

Additonally we could just add conditions and contexts to brewing for checking if a brew can be drunk first, this may be good anyway.

Checknig for if in PvP with PVPmanager or in a worldguard claim, to prevent use in an event or spawn etc.

@Jsinco
Copy link
Member

Jsinco commented Aug 24, 2024

This would be possible with depenizen if/when that ever gets merged by those guys. If you know a bit of java you can also just use brewery's api too. Adding a feature that allows you to cancel drinking based on returned outputs would be pretty messy to add into brewery atm and might just be something to save for those who know how to write denizen scripts, etc. If you want depenizen support to come around faster, you could probably also just ask one of the maintainers over at denizen. McMonkey accepted the pull a LONG time ago but the other maintainer has yet to review it so letting them know might remind them to check it out.

@Mitality Mitality added the enhancement New feature or request label Aug 24, 2024
@TomLewis
Copy link
Author

I don't use depenizen, my scripts are all in CommandHelper. Hence the request!
Might be better as an "addon"

@Jsinco
Copy link
Member

Jsinco commented Dec 6, 2024

It would be hard to do this without basically building our own mini-scripting language for BreweryX. Commands fire after the ItemConsumptionEvent has been fired. And there's also no way for BreweryX read the output of a command as commands don't 'return' anything.

The only way to stop a Brew from being consumed would be to prevent it through Brewery's API. This is unfortunately not an option for a lot of people which is why being able to do this through Denizen would be nice, but I understand that scripting isn't exactly the easiest thing to learn either and also Denizen support still depends on the people who maintain Denizen to merge our PR.

@Jsinco Jsinco closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants