• 0

    posted a message on HTML UI Is Broken?

    So after hours of trial and error I've come to find that the HTML support in Minecraft is very, very limited. I could honestly still achieve a lot of what I'd like to accomplish though if I could get the 'minecraft:send_ui_event' trigger to actually work. I have referenced the 'examples' but they also do not work properly when I attempt to load them.


    So I'm hoping I can at least find out if anyone here has gotten the RPG example project to work? This is the project that supposedly uses the syntax correctly. I don't know what I could be doing wrong with getting it working but any information could help me out here.. I'd really like to start pumping out mods with UIs :) .


    Thanks in advance.

    Posted in: Add-ons
  • 0

    posted a message on Speed Builder Bedrock Addon

    Hello everyone! I recently starting playing around with modding with Bedrock Edition and have created a tool for building large projects faster! I call it Speed Builder.

    I have created a website for it, you can download and try it out here: PressStartInteractive.games There is a tutorial page on the site that should hopefully get you up and running.


    For anyone looking for a reference on some of the coding side of modding, the repo for the project is public! You can find the link to it on the website.


    I have many plans to improve it that I hope to get to soon, but I also have an adventure I am working on so no dates for improvements just yet. I'd love to hear some feedback if anyone gets a chance to try it out. I have found it very helpful, I hope you do too.


    Happy crafting!

    Posted in: Add-ons
  • 0

    posted a message on HELP! Custom Mob is invisible!

    It might be that you need a models folder with geo.json files to correspond with all of your entities. I don't have any experience with this (yet), but just comparing your files to the bee files from the 14 beta resource pack I noticed that that was the only file yours seemed to be missing.


    Hope that helps!

    Posted in: Add-ons
  • 0

    posted a message on [Scripting API][Looking For Help] Collecting Input Data From HTML UI

    Hello everyone. I am currently attempting to work with the HTML UI support in the scripting beta. I currently have the UI elements displaying with working buttons. But I am having a hard time getting it to accept input. What I mean by that is I have created an <input> element on the HTML page. The box appears as expected but I cannot insert a value into it. It does not respond to mouse click events or anything, just a pretty box on the screen. :( I have also noticed that changing the 'type' on the input element does not do anything either, meaning the element always appears as an input box.


    Does anyone have a working example of an HTML UI returning a value from an input element? I'd love to take a peek at how you may have done that. So far I'm going to have to stick with button click events.

    Posted in: Add-ons
  • 0

    posted a message on Creating a longer sword

    Have you checked out bridge? I'm learning to work with it now. I think you can adjust the collision box size effectively making the sword bigger? There are probably other options hidden away in there. I wish I could give more pointed advice.


    This video has a download link to Bridge and gives an example of using it. Hope this helps! (its free)

    Posted in: Add-ons
  • 0

    posted a message on Having trouble with events in JS

    Hey guys, I'm trying to get started with scripting my own mods. But I'm having trouble working with built-in minecraft api events.


    Here is the test code. It is just a client script that should print the coordinates of the block the reticle is looking at. I've actually copy-pasted the code from the api wiki so I'm extra confused as to why it isn't working. I have two methods for displaying a message and neither show up. Could I be using them incorrectly in some way? I also tried placing a this.broadcastEvent("minecraft:display_chat_event", "test"); in the update function and that would also not display a message. I don't receive any errors, the messages just don't display.


    Does anyone have any idea of what I could be doing wrong here? Any help is appreciated.


    Edit:

    I figured out what the issued was, you cannot simply pass a string as the parameter to the broadcastEvent("minecraft:display_chat_event") function. It requires the proper event data object to be initialized first and the string added to the message property of the data property of the object. The documentation is incorrect at gameapedia, I have attempted to make corrections. I will leave my non working code here next to a set of working code to help anyone who may come across this.



    Example of NOT working code (original post)

    const aClientSystem = client.registerSystem(0, 0);
    
    // Setup which events to listen for
    aClientSystem.initialize = function () {
    
        this.listenForEvent("minecraft:hit_result_changed", eventData => this.printPosition(eventData));
    };
    
    aClientSystem.printPosition = function (eventData) {
    
        this.broadcastEvent("minecraft:display_chat_event", "Pick at x:" + eventData.position.x + " y:" + eventData.position.y + " z:" + eventData.position.z); 
        this.executeCommand("/title @a actionbar " + "x: " + eventData.position.x + " y: " + eventData.position.y + " z: " + eventData.position.z, (commandData) => this.commandCallback(commandData) );
    
    };


     


    Example of WORKING code

    Client.js:

    const aClientSystem = client.registerSystem(0, 0);
    
    // Setup which events to listen for
    aClientSystem.initialize = function () {
        this.listenForEvent("minecraft:hit_result_changed", (eventData) => this.sendResultsToServer(eventData));
        this.registerEventData("SB:location_received", {position: null});
    };
    
    aClientSystem.sendResultsToServer = function (eventData) {
        let targetBlock = this.createEventData("SB:location_received");
        targetBlock.data.position = eventData.data.position;
        this.broadcastEvent("SB:location_received", targetBlock);
    };

    Server.js:

    const aServerSystem = server.registerSystem(0, 0);
    
    
    // Register script only components and listen for events
    aServerSystem.initialize = function () {
        this.listenForEvent("SB:client_entered_world", eventData => this.onClientEnteredWorld(eventData));
        this.listenForEvent("SB:location_received", eventData => this.printLocation(eventData));
    };
    
    
    aServerSystem.printLocation = function (eventData) {
        let chatEvent = this.createEventData("minecraft:display_chat_event");
        chatEvent.data.message = "x: " + eventData.data.position.x + " y: " + eventData.data.position.x + " z: " + eventData.data.position.z;
        this.broadcastEvent("minecraft:display_chat_event", chatEvent);
    
    }
    Posted in: Add-ons
  • To post a comment, please or register a new account.