Skip to content

feat: Interaction Library - #68

Open
runcows wants to merge 1 commit into
Smithed-MC:mainfrom
runcows:feat/interaction
Open

runcows wants to merge 1 commit into
Smithed-MC:mainfrom
runcows:feat/interaction

Conversation

@runcows

@runcows runcows commented Oct 10, 2026

Copy link
Copy Markdown

This PR adds a new library smithed.interaction spinning off of the Interaction API developed for Summit '26. It enables easier usage of Interactions

This is paired with the corresponding docs PR Smithed-MC/Docs#22

@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.

Tested in game and it works for me, really great lib !, others personal opinions :

the follow and height functionality can't overlap, some users might find it strange, but they can implement that themself


id: smithed.interaction
name: Smithed Interaction
version: "1.0.0"

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.

not sure about the version, no others libs have a major version set to 1

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The other open new Lib PR is using a 1 major version 😁
But for a more serious answer, I consider the summit version the 0 major version (and I dont believe in 0 versioning :P)

store result score #check_gametime smithed.interaction.temp run data get entity @s TIMESTAMP
unless score #check_gametime smithed.interaction.temp = #current_gametime smithed.interaction.temp run return run data remove entity @s action['type']
raw f"execute on {action['on']} unless entity @s[tag=smithed.interaction.player] run return fail"
if data entity @s SHORTCUT_LOC at @s function ~/try_shortcut:

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.

I don't understand why a specific action has to be made here for the sit functionality, can't we use the function action to do the same thing

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.

i now understand that it's a syntax thing, but it would be more clear that it's just a nice function tag like #smithed.interaction:custom/sit instead of #smithed.interaction:event/on_right_click/custom/sit

just a personal opinion at this point, i don't care if it's one or the other

# -------------------- -------------------- #
# --------------------------------------------------- #
function smithed.interaction:impl/custom/sit:
# Functions

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.

needs the # @public macro for the version check, since it's in a function tag

}
}

append function_tag smithed.interaction:event/on_right_click/custom/sit {"values":[(~/)]}

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.

move the function tag at the top of the function definition, so it's clear that this is called in a function tag

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.

Also don't forget to use the prefixed calls function tag for the version check

raw # custom : sit
scoreboard objectives add smithed.interaction.sittable_id dummy
scoreboard players add #next smithed.interaction.sittable_id 0
schedule function SEC 1t

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.

you need to add theses function to the beet config in the meta.smithed.versioning.scheduled_paths

this way when two version of the lib are loaded at the same time, they can cancel the scheduled function by themself

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.

i just found that crafter don't use it, i'm going to update it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Im confused on this one, because I dont think any of the libraries use this

@edayot edayot Oct 11, 2026 •

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.

they do, because, the default value of the list is impl/technical/tick, most libs use this as the tick function, but the interaction lib doesn't

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.

this is a bit harder than i thought, i'm going to check myself and suggest an edit

Comment thread src/smithed_libraries/packs/interaction/modules/core.bolt
```
$ pip install beet mecha
$ git clone https://github.com/Smithed-MC/Libraries
$ cd Libraries/interaction

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.

this is the wrong relative path, should be Libraries/src/smithed_libraries/packs/interaction or just Libraries looking at the next command

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.

2 participants