Skip to main content

Local Player Blocks for Build Isreal

·2 mins

Local Player Blocks was one of the first major projects I’ve done; I messed up somewhat with it; however, I could make it through, and I think I did a good job. The goal of Local Player Blocks was to locally replicate Minecraft building mechanics Locally to the player or a team with packets. At first, I tried using normal events from paper; however, those events failed upon placing a ghost block on another ghost block which is what initially started me making a very complex system for this. I began by trying to get the block from the packet and adding the direction; however, the packet on ProtocolLib does not contain the actual direction data for some reason, so I had to cast the packet to access that data. The hardest thing I then had to deal with was different block states. The block states made this very hard to do as they are different for every block and do not always have an interface for them (ex., torches, and wall blocks). I then started working on this. The first thing I fixed was the Orientable blocks. These blocks are the easiest to fix but also helped me understand how to work on this. They have six faces (normally) that can be positioned in all the directions you can place a block in, so I could set the direction based on how it was placed. I then went ahead and did most other blocks and it went pretty well except for some hiccups with attachable blocks.