Skip to content
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

How to "track" block placement #46

Open
Kevin-Mattheus-Moerman opened this issue Nov 6, 2021 · 1 comment
Open

How to "track" block placement #46

Kevin-Mattheus-Moerman opened this issue Nov 6, 2021 · 1 comment

Comments

@Kevin-Mattheus-Moerman
Copy link

Is it possible to detect when a block is placed? Is block placement an event that can be monitored?

I can see examples where block hitting with the sword can be recorded, this would allow one to keep track of a sculpting (block removal) activity.

However, I'm interested in creating 3D printable models using Minecraft on Raspberry Pi. It would be great to let kids build blocks and then export the model. I think all I need is to be able to track when a block is placed.

Thanks.

@Ellipse0934
Copy link
Collaborator

Can you spawn a Task that periodically polls the positions of the required blocks ? i.e. Do a getBlock(x, y, z) compare with value in a Dict, if there is a change then push the update to a Channel or some queue like DataStructure.

I can't recall but I think you can get away with a couple of thousand API calls depending on the machine. If you are on the R-Pi maybe it's hundreds of calls a seconds..Polling isn't the same as an absolute guarantee but if a human is placing a block polling 2-3 times a second should be more than sufficient. I can write an example if it's helpful.

I'm interested in creating 3D printable models using Minecraft on Raspberry Pi

What kind of models are you looking to create ? I don't have any experience with 3D printing hence am unsure of how I can be of help. Right now if you know the coordinates of a the region you are looking to copy you can use copyModel to convert that into an Array{Block, 3} type. Then use a texture pack to generate a good 3-D model. It's obviously some work via the PiCraft.jl pipeline and you may be better served with external software that already exists for this task.

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

No branches or pull requests

2 participants