JomarMilan

JomarMilan

0-day streak
I've released a new minor update for Block Coding for Minecraft! Now, the WebSocket server is encrypted, so 'Require Encrypted WebSockets' no longer needs to be disabled! (This was really difficult to pull off, so it makes me kind of sad that all that changes for users is that they don't need to care about an option in the game. At least I learned a lot about cryptography.) There are also buttons to save and load the workspace to files now, which should make it easier to organize multiple workspaces and share them! I learned a lot about cryptography working on this update, since prior to this the extent of my knowledge pertaining to encryption was how to use GnuPG. A few of the things that I learned are that AES works in blocks, that there are a lot of different modes of AES, that Electron uses BoringSSL and Node.js uses OpenSSL, and about the Diffie-Hellman key exchange. github.com/MacaylaMarvelous81/minecraft-code
https://scrapbook-into-the-redwoods.s3.amazonaws.com/cfa2f7f1-d035-48c5-9d66-65ca37fd8844-screenshot_2024-08-20_at_9.02.58___pm.pnghttps://scrapbook-into-the-redwoods.s3.amazonaws.com/53ee3f51-857b-4e3e-a572-2f295f414d40-screenshot_2024-08-20_at_9.02.29___pm.png
I've got 'Block Coding for Minecraft' into a good enough state that I feel comfortable to make a first release! This is my first Electron app. It connects to Minecraft: Bedrock Edition and uses Blockly to make blocks you can use to write code and interact with the Minecraft world. Currently, you can control the player and Agent. In the future releases, I want to add more blocks that interact with other aspects of the world, like blocks, mobs, and the player chat. I also want to add more ways to save your work, enable viewing and writing JavaScript code instead of blocks, and upgrade the WebSocket connection with encryption. To use the app, open it and click the Connect button to see the port. Then, in a Minecraft: Bedrock Edition world with cheats enabled, use the command /connect host:port , with host being a hostname or IP address to the machine running the app and port being the port displayed in the app. Encrypted WebSockets aren't implemented yet, so you might need to turn off 'Require Encrypted Websockets' in the Minecraft profile settings. The app should be connected to the game and the 'Connect' button should turn into the 'Run' button. github.com/MacaylaMarvelous81/minecraft-code
https://imgutil.s3.us-east-2.amazonaws.com/35767caea5c2db02fa3c917eb4a3dd4451ed0d256aac60f9031e4c5e34f168c4/18273c01-7665-4994-bfdf-1cacf8c98f7f.png
Today I got events working! I replaced JS-Interpreter with sval which lets me call the functions defined in the interpreted code. I think it's because it doesn't use 'pseudo' objects like JS-Interpreter does. It doesn't yet support await, so I had to switch to using sendSync instead of invoke with Electron ipc. Currently, the only event from the game I have is an event when the player dies. I could add more events, but they would be more useful if the event data could be used, so I want to figure that out first. I'm thinking that I could use value blocks to represent the last data received from an event, like in the picture.
https://scrapbook-into-the-redwoods.s3.amazonaws.com/f0bd2528-157d-4c92-ac85-36521d2149c2-excalidraw-minecraft-code.png
Made progress on the block coding for Minecraft! Now, there's a new Coordinate 'type' which holds x, y, and z values. The blocks that deal with coordinates use this type instead of the individual numbers for each axis used previously, which means less back-and-forth calls to the game and significantly faster performance when dealing with coordinates! I've also added more blocks for the Agent, and made up a name for the project: 'Code Blocks for Minecraft'. I don't think it's a very good name, but I like it better than the 'minecraft-code' temporary name I was using before, especially since I want to make it clear I'm not affiliated with Minecraft, Mojang, or Microsoft. I also started making the programming event-based, but I've hit a big snag. With JS-Interpreter, which I'm using to run the code generated by the blocks, I can't call pseudo functions (functions defined in the interpreted code) from native code. Unfortunately, this means I can't use a callback approach towards event handlers. I'm thinking of interpreting event handlers separately, but I'm not sure functions and variables defined by the user would work correctly if I did that.. and it would be really annoying, especially if I want to add a feature to show the generated code to the user later, like how MakeCode lets you see and edit the code in JavaScript. I don't know what to do, but hopefully I'll figure something out.
https://scrapbook-into-the-redwoods.s3.amazonaws.com/d1aa4718-0d4b-4ce6-bce6-87f5923f5188-screenshot_20240809_231246.png
Got started on a project where you can code with blocks to control the game and an Agent in Minecraft: Bedrock Edition, just like in the Education Edition and the deprecated Code Connection! I'm using Electron for the app since the web browser can't make a WebSocket server to interact with the game, and Blockly for the block coding. It generates code to JavaScript like agent.teleport(null, 100, null) which goes through JS-Interpreter to Electron to the WebSocket server to Minecraft. I only have a few blocks so far, and I hope to add events, but I think I've got the basics!
https://scrapbook-into-the-redwoods.s3.amazonaws.com/89f0e332-8bdf-46b3-a65e-fa37205e9609-image.png
I finally took care of all the issues in my Minecraft mod Datapack Installer!! I started this project a few years ago, but Arcade helped motivate me to stick to it when working on the Issues instead of giving up when it starts getting tough. In other words, Arcade really encouraged me to challenge myself! I was able to implement dedicated server use (issue 1) and changing data packs in existing worlds (issue 3). Working on this mod also helped me learn more about the SpongePowered Mixins! Before working on this mod in Arcade, I'd never needed to use Accessors, and I hadn't known about Override and capturing locals. I'm really grateful for Arcade. I don't think I could have made the mod this good without the 1hr timers. github.com/MacaylaMarvelous81/DatapackInstaller modrinth.com/mod/dp-installer
https://imgutil.s3.us-east-2.amazonaws.com/e29bf96c443e196a2b75b36bc2119f26ab49f0182ef4bf74b72baaedb0bcc460/625d05d9-3501-4a88-bdbd-a839223679db.png