Add concrete cauldron conversion QoL - #30
Open
Kauziin wants to merge 1 commit into
Open
Conversation
## Scripts - registered the new concrete cauldron QoL runtime from BP/scripts/main.js. - convert concrete powder stacks into their matching concrete blocks when used on filled vanilla cauldrons. - consume cauldron water based on the converted stack size and drop overflow safely when the player inventory is full.
There was a problem hiding this comment.
Pull request overview
Adds a new QoL interaction that lets players right-click a (filled) vanilla cauldron with concrete powder to convert it into matching concrete, consuming cauldron water and spilling overflow items when the inventory is full.
Changes:
- Register a new
world.beforeEvents.playerInteractWithBlockhandler forminecraft:cauldron. - Convert
<color>_concrete_powderinto<color>_concreteup to a per-fill-level cap, then reducefill_level. - Add converted items to inventory and spawn overflow above the cauldron.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| BP/scripts/qol/concrete_cauldron.js | Implements the cauldron → concrete conversion behavior and water consumption logic. |
| BP/scripts/main.js | Imports the new QoL module so it registers at runtime. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| event.cancel = true | ||
|
|
||
| const selectedSlot = player.selectedSlotIndex |
Comment on lines
+26
to
+30
| const fillLevel = block.permutation.getState('fill_level') | ||
| if (typeof fillLevel !== 'number' || fillLevel < 2) return | ||
|
|
||
| const concreteId = getConcreteId(itemStack.typeId) | ||
| if (!concreteId) return |
Comment on lines
+67
to
+71
| const cauldronBlock = player.dimension.getBlock(location) | ||
| if (!cauldronBlock || cauldronBlock.typeId !== 'minecraft:cauldron') return | ||
|
|
||
| const nextLevel = Math.max(0, fillLevel - getLevelsConsumed(toConvert)) | ||
| cauldronBlock.setPermutation(cauldronBlock.permutation.withState('fill_level', nextLevel)) |
Comment on lines
+40
to
+47
| system.run(() => { | ||
| const inventory = player.getComponent('minecraft:inventory')?.container | ||
| const currentItem = inventory?.getItem(selectedSlot) | ||
|
|
||
| if (!inventory || !currentItem || currentItem.typeId !== itemStack.typeId) return | ||
|
|
||
| const toConvert = Math.min(currentItem.amount, maxConvertible) | ||
| if (toConvert <= 0) return |
Comment on lines
+67
to
+71
| const cauldronBlock = player.dimension.getBlock(location) | ||
| if (!cauldronBlock || cauldronBlock.typeId !== 'minecraft:cauldron') return | ||
|
|
||
| const nextLevel = Math.max(0, fillLevel - getLevelsConsumed(toConvert)) | ||
| cauldronBlock.setPermutation(cauldronBlock.permutation.withState('fill_level', nextLevel)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Files touched
BP/scripts/main.jsBP/scripts/qol/concrete_cauldron.jsNotes