microsoft / minecraft-scripting-samples

Contains various samples of GameTest Framework JavaScript + Minecraft Bedrock Edition
MIT License
137 stars 27 forks source link

Running these scripts on a dedicated bedrock server on linux #8

Open jareddr opened 1 year ago

jareddr commented 1 year ago

Hi,

First, thank you so much for the great resources! I'm very excited to try to build some custom minecraft experiences for my kiddo and his friends.

This isn't an issue with the repo, but I'm new to minecraft development and I'm not sure where to go to ask this type of question.

I'm trying to get the ts-starter project running but I've run into a couple problems.

First, I've modified my gulp file to tell it that I'm running a dedicated server and have set up my paths such that when I run gulp build I can see the staterbp ending up built and copied to the correct spot.

From there I cannot figure out how to get the behavior pack to get picked up by the game. I've tried having it copied to both development_behavior_packs and also behavior_packs but I'm not seeing it in either case. I connect to my dedicated server and do not see the 'Hello starter!' printed out.

I also modified the code to reset the tickIndex counter to 0 every time it gets to 100, wondering if the printout was happening before I was able to load into my server, but alas, this didn't help either.

I've tried restarting the server and reconnecting with no luck.

Are there some settings I need to configure on my server to enable the loading of development_behavior_packs?

Thanks so much!

Jared

nullkiller commented 1 year ago

I also tried it on Windows with no luck as well. Did exactly the same. I think this is server problem. Here is my server output NO LOG FILE! - setting up server logging... [2022-10-30 09:09:37:730 INFO] Starting Server [2022-10-30 09:09:37:733 INFO] Version 1.19.40.02 [2022-10-30 09:09:37:735 INFO] Session ID 696ca6f2-bf6f-4e86-befc-7f301344a797 [2022-10-30 09:09:37:759 INFO] Level Name: NK [2022-10-30 09:09:37:764 INFO] Game mode: 0 Survival [2022-10-30 09:09:37:767 INFO] Difficulty: 2 NORMAL [2022-10-30 09:09:37:072 INFO] Content logging enabled. Writing log to: ContentLog__Sunday__2022_October_30__09_09_37 [2022-10-30 09:09:37:180 INFO] Experiment(s) active: ddi_, biom, ucft, gtst, mola [2022-10-30 09:09:37:185 INFO] opening worlds/NK/db [2022-10-30 09:09:53:137 INFO] IPv4 supported, port: 19132 [2022-10-30 09:09:53:140 INFO] IPv6 supported, port: 19133 [2022-10-30 09:09:55:387 INFO] Server started. [2022-10-30 09:09:55:455 INFO] ================ TELEMETRY MESSAGE =================== [2022-10-30 09:09:55:460 INFO] Server Telemetry is currently not enabled. [2022-10-30 09:09:55:463 INFO] Enabling this telemetry helps us improve the game. [2022-10-30 09:09:55:467 INFO] [2022-10-30 09:09:55:469 INFO] To enable this feature, add the line 'emit-server-telemetry=true' [2022-10-30 09:09:55:473 INFO] to the server.properties file in the handheld/src-server directory [2022-10-30 09:09:55:478 INFO] ====================================================== [2022-10-30 09:09:55:740 INFO] Please note that LAN discovery will not function for this server. [2022-10-30 09:09:55:745 INFO] Server IP must be specified in Servers tab in game.

I am not able to find any extra logs.

Command script debugger listen 19114 also does not work Unknown command: script. Please check that the command exists and that you have permission to use it.

nullkiller commented 1 year ago

Also tried to put this behavior into Android build and no reaction as well. I do not have Windows edition of minecraft bedrock unfortunately so can not follow the sample exactly and have to use BDS.

nullkiller commented 1 year ago

Btw I found that the world name in gulpfile for BDS is hardcoded to 'Bedrock level'. And this is not moved to any variable in configurable section. So I do not think it causes our issue, just noticed this.

Goodstuff4UonYT commented 1 year ago

@nullkiller @jareddr I have the exact same problem with linux. Did you find a solution?

nullkiller commented 1 year ago

I found an interesting project on top of mincraft BDS. https://github.com/LazuliKao/BDSLiteLoader Was enough for me

Kysan commented 1 year ago

same problem for me

KagChi commented 1 year ago

Does this only working on beta? didnt working for me on stable.

weagle08 commented 1 year ago

How I run scripts on bedrock server hosted on Ubuntu Server 22.04:

  1. cd to your worlds/[my-world]
  2. create a behavior_packs directory
  3. copy your custom script behavior pack into this behavior_packs directory ex: worlds/[my-world]/behavior_packs/[my-custom-behavior-directory]
  4. create a file at the top level of your world called world_behavior_packs.json ex: worlds/[my-world]/world_behavior_packs.json
  5. add the UUID of your custom behavior pack to this json... will looks something like:
    [
    {
        "pack_id": "[your-beahvior-uuid]",
        "version": [0,0,1]
    }
    ]
  6. restart your server, you should see your custom scripts run, any errors will print to the console

NOTE: it seems your scripts have to be in a scripts directory no matter where your manifest.json says they are

BaksiLi commented 10 months ago

I get [Scripting] Plugin [XXX - 1.0.0] - requesting dependency on module [@minecraft/server] but it is not configured to use it.

So confused.

nox7 commented 6 months ago

I get [Scripting] Plugin [XXX - 1.0.0] - requesting dependency on module [@minecraft/server] but it is not configured to use it.

So confused.

This happens when your Bedrock server is missing the directory "SERVER_ROOT/config/default" and the "permissions.json" file (missing or it has the wrong modules allowed in it).

Re-download the Bedrock server from the Minecraft website to get the default file to allow your BP to have those modules enabled and "configured" to remove that message.

(Couldn't find this anywhere, so I am posting it here to help anyone else Googling)

MeanChicken commented 1 month ago

I solved this by correcting the UUID folder name inside the configs folder. When you add a behavior pack, you also need to add a permission.json file. A folder with the name as the behavior pack UUID found within the manifest.json should be added to the configs folder

Example folder hierarchy: