Skip to content

KubeJS script for automating Brewin' And Chewin' Keg as well as more intellignt interactions.

License

Notifications You must be signed in to change notification settings

V972/BrewinAndChewinKegAutomationJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Brewin' and Chewin' - Keg Automation w/ KubeJS

I like Brewin' and Chewin' mod. I really do.
However, the 1.18.2 version has a bug/flaw/incomplete feature set -- you can't hopper items into the top slot.

And seeing how it won't receive a fix/patch/update AND sharing frustration about it with others,
I basically went and said:
Fine, I'll do it myself

And so, after remembering that KubeJS exists, tinkering w/ it for the past several days, as well as having to decompile the mods (special thanks to @chiefarug over at KubeJS Discord server) because no public repo 😬

I present to you this script.

It adds custom left-click functionality, allowing to fill both the bugged/flawed/incomplete top slot as well as ingredient slots intelligently.

Video demonstration:

Watch the video

.
"That's all fine and dandy," -- you may ask, -- "what the hell do you mean by "intelligently"? What's intelligent about it?"

Good question. Here's the rundown of the logic:

Post-2023-Minecraft-Live Tl;dr Edit: It's basically like crafter, but also fills less filled slots.

When you left-click the Keg:

  • with something in hand
  • while not crouching and not in creative

the script takes whatever you were holding and depending on the face you clicked on does one of 2 things:

  1. Inserts it into ingredient slots if clicking on the top of the keg;
  2. Inserts it into the top slot if clicking on the front or the back of the keg;

When doing so, the script tries to insert as many items as it can into that slot, up to stack size of that item.
E.g. If you were holding 16 Honey bottles, then 16 bottles will go into the slot.
If you were holding 10 and the there were another 10 already in the slot, the script will only take 6, leaving 4 in your hand.

And ofc, the ✌️Intelligent✌️ inserting into ingredient slots is essentially a round-robin with preference for smallest count.
i.e. each insertion will prioritise empty slots, then slots w/ same item and smaller count then w/ bigger count.

e.g. If all 4 slots are empty, with 4 click you will sequentially fill all the slots, thus, completing the recipe!
Good luck reliably achieving this with hoppers!

Here's how the slots are cycled:
keg_slot_order

If you're confused, perhaps a video demonstration will be more informative.

Video demonstration:

Watch the video

.
And ofc, this wouldn't be automation if it didn't work w/ Create.
Luckily it does!

As deployers have attack mode and work perfectly with this script, this allows for full keg automation!

Theoretically, this will work will any other click simulators, provided they can Left-click with item(s) in "hand".

Video demonstration (and example setup):

Watch the video

Installation and Downloads.

For installation, simply toss it into <MC folder>\kubejs\server_scripts.

In case you had a world open don't forget to run /kubejs reload server_scripts and then /reload to reload the server scripts.

Have fun automating!

P.S.

Is it kinda janky?
Yes, yes it is.

Is it a crutch?
Oh, absolutely.

Does it do the job and lets you automate brewing at least somehow?
Also yes.

About

KubeJS script for automating Brewin' And Chewin' Keg as well as more intellignt interactions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published