mojira.dev

Stephen John Anderson

Assigned

No issues.

Reported

No issues.

Comments

I am also witnessing this issue, in v1.16.40.

Steps to Reproduce:

  1. Create a behaviour pack with a server side script:
    {{}}

    let serverSystem = server.registerSystem(0, 0);
    
    serverSystem.debug = function (msg) {
        let BroadcastEventData = serverSystem.createEventData("minecraft:display_chat_event");
        BroadcastEventData.data.message = msg;
        serverSystem.broadcastEvent("minecraft:display_chat_event", BroadcastEventData);    
    };
    
    serverSystem.initialize = function() {
        serverSystem.listenForEvent("minecraft:block_interacted_with", (eventData) => serverSystem.checkBlock(eventData));
    };
    
    serverSystem.checkBlock = function (eventData) {
        const { block_position } = eventData.data;
        const { x, y, z } = block_position;
        const tickingArea = this.getTickingArea();
        const block = this.getBlock(tickingArea, x, y, z);
        serverSystem.debug(JSON.stringify(block));
    };
    
    serverSystem.getTickingArea = function () {
        let tickingAreas = this.getComponent(server.level, 'minecraft:ticking_areas');
        return tickingAreas.data['custom'];
    };
  1. Install your behaviour pack

  2. Create a Creative world with experimental gameplay and cheats turned on.

  3. Enable your behaviour pack on your newly-created world

  4. Enter the world

  5. Create a ticking area:

    /tickingarea add circle ~ ~ ~ 1 custom
  1. Add a button of any kind to the ground immediately in front of you

  2. Interact with the button

Observed Results:

The text

<ServerScript> null

appears in the chat log.

Expected Results:

**A JSON representation of the block's properties should appear in the chat log.