Giter Site home page Giter Site logo

Comments (3)

vorburger avatar vorburger commented on May 27, 2024

Basic escaping actually works - the problem with the command above is that it contains JSON which itself contains embedded escaped JSON.. that's a bit particular, but Minecraft does this e.g. for the Books.

I've attempted to fix this in https://github.com/vorburger/minecraft-storeys-maker/compare/issue92_runCommand-encoding (where at least in the current version with the first commit the test does NOT actually pass), but can't for the life of me get the replace and RegExp in JS to work correctly... I'm not sure if Vert.x is doing some additional escaping, or if I'm just dumb.

@edewit if you can spot what I'm doing wrong, please shout / amend that branch. I've already tried '\\"" instead of '\"" - that doesn't help.

from minecraft-storeys-maker.

vorburger avatar vorburger commented on May 27, 2024

BTW: That new test (above) does NOT even print Uncaught SyntaxError: Invalid or unexpected token, so perhaps there are several problems here? Like escaping issue from the block in Flash to a JS extension AND on our side? This may be easier in Scratch 3 than 2.

from minecraft-storeys-maker.

vorburger avatar vorburger commented on May 27, 2024

Yeah that (above) is the real problem here... this seems to be an escaping related bug in the Scratch (v2) Flash-to-JS bridge! It works and I can give myself fancy book if I put this into our '/' command block - note the double \\" here:

give michaelpapa7 written_book 1 0 {pages:["{\\"text\\":\\"Hello\\"}"],title:"First Quest",author:"https://www.learn.study",display:{Lore:["The first quest is your first test..."]}} 

That's a good-enough workaround. I'll mark this issue as a Low and post-Scratch3 problem...

from minecraft-storeys-maker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.