Best method to create and move blocks around the player?

Status
This thread has been locked.

Paper Cars

Audio Production Services
Supreme
Feedback score
8
Posts
514
Reactions
103
Resources
0
I've been working on a big plugin to try and get back into plugin development, and I've run into a problem.
Goal: the goal is to create a preview for my build system I've been working on. I want to use slimeblocks to create a "preview" for the player building only. The way this system works was inspired slightly by Fortnite's build system. For those unfamiliar with the game, in Fortnite when you enter build mode you have a few options to choose from, and when you have an option selected you see a semi-transparent preview of what you are about to build so you can accurately place your build. Then when you click whatever your build key is (I believe its your fire key) materials are taken from your inventory and you place the building. I want to achieve this using slime blocks. The player building should be able to see the slimeblocks, but no other players should. Any suggestions on ways to accomplish this?

I have the paper set up, Ive got it so that when the player left clicks with the paper they place the build, when they right click, they change the type of build. I just need the preview to work.

I know I need to get the players location, and make the blocks location based on that, but I cant remember how to even move one block, let alone 9 lol.
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Spoch

Developer & Game seller
Supreme
Feedback score
13
Posts
269
Reactions
112
Resources
0
I figured this was a good opportunity for me to learn some extra math so I made this:
https://gyazo.com/4482769fec26e9d012d281640a489c06
upload_2019-11-14_20-53-31.png
Took me way to long to figure out the math for rotating coordinates of stuff facepalm

If all you want to do is move regular blocks you would just delete the old ones and place the new ones.
You may want it to be client sided, I think you would be able to do that by using packets - If you do decide to use packets you have to make sure to keep record of what blocks have been sent to the players so they can be removed later. If a player stands on a block that is "fake" they will likely be kicked for flight.
Other options are armor stands or fallingblocks - both can be moved independently of Minecrafts block "grid" and it allows you to make smooth transitions or animations aswell.
 

Attachments

  • upload_2019-11-14_20-53-31.png
    upload_2019-11-14_20-53-31.png
    31.5 KB · Views: 64

Paper Cars

Audio Production Services
Supreme
Feedback score
8
Posts
514
Reactions
103
Resources
0
I figured this was a good opportunity for me to learn some extra math so I made this:
https://gyazo.com/4482769fec26e9d012d281640a489c06
Took me way to long to figure out the math for rotating coordinates of stuff facepalm

If all you want to do is move regular blocks you would just delete the old ones and place the new ones.
You may want it to be client sided, I think you would be able to do that by using packets - If you do decide to use packets you have to make sure to keep record of what blocks have been sent to the players so they can be removed later. If a player stands on a block that is "fake" they will likely be kicked for flight.
Other options are armor stands or fallingblocks - both can be moved independently of Minecrafts block "grid" and it allows you to make smooth transitions or animations aswell.

Thanks! I'll play with this and let you know how it works out!
 
Status
This thread has been locked.
Top