mojira.dev

old-mate-jim

Assigned

No issues.

Reported

BDS-18725 [Scripting] isOp() returns false when players are operator Confirmed

Comments

This is still a valid issue because you can't add behavior packs to bedrock dedicated server without loading the world in Minecraft Bedrock Edition and applying the pack there. Then have to export again back to the server. 

This is extremely clunky and I highly doubt it's how it was intended to work considering that the official documentation doesn't say this. 

It should only be a matter of adding the behavior pack to the behaviour_packs directory and updating the world_behaviour_packs.json. However this does not work. The behaviour pack won't be applied to a world that is generated by the BDS even if everything was done correctly per the documentation.

If this is in fact how it was intended, then your documentation needs to be updated accordingly. 

According to this https://minecraft.wiki/w/Server.properties the op-permission-level property is for Java Edition. This issue is for the Bedrock Server.

I have confirmed that the issue is present on Windows also.

 

Steps to Reproduce:

  1.  Download the [Minecraft Bedrock Server Download | Minecraft|https://www.minecraft.net/en-us/download/server/bedrock] for either Windows or Linux.

  2.  Run the server and wait until console is idle and world is running then stop it (this makes sure the world is created)

  3.  Stop the server

  4.  Extract the contents of attached Example_Behavior_Pack.zip to the directory:  ./behavior_packs/Example_Behavior_Pack

  5.  Place the world_behavior_packs.json and level.dat files in the ./worlds/Bedrock level/ directory

  6.  Open Minecraft for Windows

  7.  Join the Server

  8.  You will see in the console "Player is not op"

  9.  Run the command in the console to give yourself operator permission "op <player_name_here>"

  10.  Note the command output says "Opped <player_name_here>"

  11.  Leave the server.

  12.  Rejoin the server

  13.  You will see in the console "Player is not op"

  14.  Open the menu 

  15.  You will see you do have operator permission but the server is not recognizing it.

 

Here is the code that checks the operator status using the Minecraft Script API specifically, this part: minecraft/server.Player Class

 

 

import * as server from "@minecraft/server"
server.world.afterEvents.playerSpawn.subscribe(onAfterPlayerSpawn)
/** 
 *  
 * @param {server.PlayerSpawnAfterEvent} eventData
 */
function onAfterPlayerSpawn(eventData) {    
    console.log(`Player ${eventData.player.isOp() ? "is" : "is not"} op`)
}

 

Observed Results:

The player is not being recognized as having operator status even though they do.

Expected Results:

When the player with operator status spawns, the message should say "Player is op".

Additonal Info:

Link to Video: MinecraftScriptingBug

Video Also Attached

 

Firstly, I am aware of how JIRA works. I am a .NET Software Engineer and use the same platform. That's very poor workflow management if you're marking them as resolved instead of one more suitable. 

FYI this is a regression. It was working fine in 1.20.15 but not in 1.20.30.

Can you tell me what you have tried so far so I can make corrections that will allow you to reproduce the issue?

Ok. Can you stop marking it as resolved then? It's not resolved.

I haven't tested on any other platforms so I don't know. Doesn't seem like something that would be platform specific.

Really? Marking it resolved without even looking into it. I'm not sure how much clearer I could have been.

 

Steps to Reproduce:

1. Make a Bedrock Dedicated Server

2. Use the Minecraft Script API

3. Call the function Player.isOp() in the context of a Player who is operator e.g. using the PlayerBreakBlockAfterEvent

4. Observe the result with console.log()

 

Observed Results:

The function always returns a value of false even when the player is operator 

 

Expected Results:

The function returns true when the player is operator 

Had the same problem.

The minecarts need to be within ticking distance to move. A workaround is adding the rail system as a ticking area using the tickingarea command:

Commands/tickingarea – Minecraft Wiki (fandom.com)