-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Interactive blocks #333
Interactive blocks #333
Conversation
very impressive! would be nice to get this merged so additional interactive blocks can be added! Feature works before the master merge |
Yeah I know it's currently broken. The shrinking of the json completly destroyed my code :( |
Works pretty good. Only problem is when the Jukebox is destroyed the Music is still playing. I think you should implement a function which gets called when a block is destroyed |
Sounds good. Kinda forgot about that. Will add that soon |
@Snowiiii Done |
Tested again and everything including the block destruction works fine :D. |
Description
This PR aims to add interactive blocks such as crafting tables, furnances and many more.
How to use:
#[pumpkin_block("minecraft:<your_block_id>")]
and specify your block idPumpkinBlock
for your blockmanager.register(<YourBlock>);
Currently implemented block events
on_use
: Gets called when clicked with an empty handon_use_with_item
: Gets called when clicked with an itemon_placed
: Gets called after placing a blockon_broken
: Gets called after the block is removedNote: The
on_use_with_item
needs aBlockActionResult
which can beContinue
andConsume
Testing
Start up the server, place a jukebox, insert a disc and start vibing
Checklist
Things need to be done before this Pull Request can be merged.
cargo fmt
cargo clippy