Skip to content

fix(actionbar): port vanilla interactions to 26.2 - #63

Merged
edayot merged 15 commits into
Smithed-MC:mainfrom
bigyasso730:26.2
Aug 16, 2026
Merged

fix(actionbar): port vanilla interactions to 26.2#63
edayot merged 15 commits into
Smithed-MC:mainfrom
bigyasso730:26.2

Conversation

@bigyasso730

Copy link
Copy Markdown
Contributor

Overview

Fixes #62

This PR fixes vanilla Actionbar block interaction detection and ports the
affected Actionbar advancements to the Minecraft 26.2 data pack format.

Problem

The Actionbar library currently uses minecraft:item_used_on_block to
detect interactions with vanilla blocks.

This is too restrictive for reproducing vanilla Actionbar behavior.
For example, right-clicking a lockable block with a stick does not trigger
item_used_on_block, while placing a block does.

As a result, some legitimate block interactions do not produce the expected
Actionbar message.

Changes

  • Replace minecraft:item_used_on_block with minecraft:any_block_use
    where generic block interaction is required.
  • Remove redundant empty-hand criteria using minecraft:air.
  • Remove the now-unnecessary requirements sections where only a single
    criterion remains.
  • Keep separate occupied and unoccupied criteria for beds.
  • Update block predicates from tag to blocks.
  • Update the legacy Lock block data field to lock.
  • Remove the obsolete top-level conditions.location from
    slept_in_bed.json.

Bed interactions

clicked_bed.json previously had four criteria:

  • unoccupied
  • occupied
  • unoccupied_empty
  • occupied_empty

The empty-hand criteria were removed because any_block_use can detect
the block interaction directly.

The advancement now has two criteria:

  • unoccupied
  • occupied

This preserves the distinction needed by the Actionbar implementation
while avoiding duplicate interaction criteria.

Lockable blocks

clicked_lockable_block.json now uses a single any_block_use criterion.

It checks that:

  • the player is not sneaking;
  • the Actionbar library version is loaded; and
  • the interacted block belongs to the lockable block tag.

The previous empty-hand criterion and requirements section are no longer
needed.

26.2 compatibility

The affected block predicates have been updated from:

"tag": "..."

to:

"blocks": "#..."

The container lock check has also been updated from the legacy Lock
block data field to the current lock field.

The slept_in_bed advancement no longer uses the obsolete top-level
conditions.location field.

Testing

Tested the Actionbar interactions for:

  • Right-clicking lockable blocks with a stick.
  • Placing blocks against lockable blocks.
  • Empty-hand interactions.
  • Sneaking interactions.
  • Occupied beds.
  • Unoccupied beds.
  • Sleeping in beds in the Overworld.

The Actionbar library also builds successfully with Beet.

clicked_bed.json 26.2 porting and restrictive fix
slept_in_bed.json 26.2 port and restrictive fix
clicked_lockable_block 26.2 port and restrictive fx
check_lock.mcfunction 26.2 port and capitaization fix
east.mcfunction 26.2 port and capitalization fix
north.mcfunction 26.2 port and capitalization fix
south.mcfunction 26.2 port and capitalization fix
west.mcfunction 26.2 port and capitalization fix
clicked_bed.mcfunction removed occupied_empty check due to optimizations in clicked_bed.json advancement file.
@bigyasso730 bigyasso730 changed the title 26.2 fix(actionbar): port vanilla interactions to 26.2 Aug 15, 2026
@bigyasso730

Copy link
Copy Markdown
Contributor Author

I apologize for the accidental Merge pull request from commit 10, if this pull request is merged, can it be squashed first?

@edayot edayot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to me, some problems needs to be solved.

If you need help for the beet setup, feel free to ask on the discord server.

Note for myself : I DID NOT TEST ANYTHING INGAME

PS: on merge we will definitely squash commits

],
"rewards": {
"function": "smithed.actionbar:impl/vanilla/bed/clicked_bed"
"function": "smithed.actionbar:v0.7.0/vanilla/bed/clicked_bed"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the impl/ is automaticly replace in the beet pipeline, pls rollback this change

"predicate": {
"block": {
"tag": "smithed.actionbar:impl/lockable"
"blocks": "#smithed.actionbar:v0.7.0/lockable"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, rollback the impl change

],
"rewards": {
"function": "smithed.actionbar:impl/vanilla/container/clicked_lockable_block"
"function": "smithed.actionbar:v0.7.0/vanilla/container/clicked_lockable_block"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

"predicate": {
"block": {
"tag": "smithed.actionbar:impl/lockable"
"blocks": "#smithed.actionbar:v0.7.0/lockable"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

"trigger": "minecraft:default_block_use",
"conditions": {
"player": [
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

"min": 1
}
}
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I apologize for the load_status and impl changes, I accidentally used the compiled version, I fixed them, if you need any other changes I'm here to help.

@bigyasso730
bigyasso730 requested a review from edayot August 16, 2026 14:10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only part for raw string, that should not be quoted or having colors, nobody use them, it's not a big deal

@edayot

edayot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution, i tested in-game and it was working fine for both of them !

@edayot
edayot merged commit af54ac0 into Smithed-MC:main Aug 16, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Aug 16, 2026
… + bump (custom-block & crafter) to support 26.2

* Update clicked_bed.json

clicked_bed.json 26.2 porting and restrictive fix

* Update slept_in_bed.json

slept_in_bed.json 26.2 port and restrictive fix

* Update clicked_lockable_block.json

clicked_lockable_block 26.2 port and restrictive fx

* Update check_lock.mcfunction

check_lock.mcfunction 26.2 port and capitaization fix

* Update east.mcfunction

east.mcfunction 26.2 port and capitalization fix

* Update north.mcfunction

north.mcfunction 26.2 port and capitalization fix

* Update south.mcfunction

south.mcfunction 26.2 port and capitalization fix

* Update west.mcfunction

west.mcfunction 26.2 port and capitalization fix

* Update clicked_bed.mcfunction

clicked_bed.mcfunction removed occupied_empty check due to optimizations in clicked_bed.json advancement file.

* Update clicked_bed.json

* Update slept_in_bed.json

* Update clicked_lockable_block.json

* fix: raw message should not have quotes nor colors

* chore: bumping libs and minecraft version

---------

Co-authored-by: edayot <pro.e.dayot@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: smithed.actionbar: advancement for detecting clicks on bed (and others) is too restrictive (item_used_on_blocks)

2 participants