#How to edit minecraft:scale

1 messages · Page 1 of 1 (latest)

supple minnow
#

How can I edit the minecraft:scale component of an entity with the script api?

woven warren
#

Need to create an event inside the JSON file for the entity like player.json for example. You need to create component groups that can be called on by the event to scale the player. The scaling value will be hard coded in this instance. Once you accomplish this you can trigger the event with something like player.triggerEvent("name_of_event");

player.json (component groups)

        "component_groups": {
            "scaleupped": {
                "minecraft:scale": {
                    "value": 1
                }
            },
            "scaledowned": {
                "minecraft:scale": {
                    "value": 0.4
                }
            },

player.json (events)

        "events": {
            "scaleup": {
                "add": {
                    "component_groups": ["scaleupped"]
                },
                "remove": {
                    "component_groups": ["scaledowned"]
                }
            },
            "scaledown": {
                "add": {
                    "component_groups": ["scaledowned"]
                },
                "remove": {
                    "component_groups": ["scaleupped"]
                }
            },

In scripting I can call on scaledown with the triggerEvent method and it will change the scale of my player to 0.4 and if I do the same thing but call on scaleup it will change the scale back to default which is a value of 1.

#

It works like a toggle switch if that makes sense.

supple minnow
#

tried that

#

doesnt work

#

at least not in stable minecraft

#

maybe in preview

woven warren
#

That never worked for me in the past which is why I took the other approach.

supple minnow
#

it is tho lmao

#

i literally use it

#

yes i meant beta

winter flower
#

release = non beta scripting, not conclusive on which version of the game
stable = release version of the game
beta = beta scripting modules, not conclusive on which version of the game
preview = preview version of minecraft

#

So it's not wrong to call it stable here

#

Would just need to clarify that beta modules are being used

#

And if we go by npm versioning, beta actually refers to beta modules on preview, so it would be wrong to just say beta here

#

Stable actually isn't even an officially used word so there is no right or wrong here, just a standard that is normally followed

#

The bot has a sticky on this which is more clear, my clarification may have been wrong according to it

#

So the safest bet is to just clarify which version of the game and the module version you use

#

Rather than grouping them under one name

#

I was in the middle of typing that message when you sent yours, i hadn't read it

winter flower
twilit wadi
winter flower
#

stable usually refers to release and vice versa in the context of the game version

#

beta and preview are also used interchangeably in the context of the game version

#

but the script api also has its own versions, which are called release (though not included in the version string) and beta

#

that's why it's weird to talk about script versions since you have to include both the version of the game and the script module

#

it's easiest to just specify the game version and script module version separately

#

?

#

not sure what you're correct on?

#

the docs don't say anything about being preview or anything like that

#

you should still specify the game version separately

#

I was only clarifying that instead of script modules being referred to as release, they're referred to as stable

supple minnow
#

so none of this matters lmao

winter flower
#

You never specified the script module version, which led this, so I think it matters

last thistle
#

I have different name for Script API version and is not really ambiguous

  • Stable API
  • Pre-Release API (Stable API on Preview)
  • Beta API (This refer Beta version of API on Minecraft Stable)
  • Preview API (Beta API on Minecraft Preview)
hardy compass
#

stop arguing, this is clearly what stable refers to 😤

winter flower
#

100% agree

supple minnow
#

agreed

woven warren
past hedge
#

Pretty funny because you can just by typing in chat change ur size to any, and it doesnt have to be hardcoded

winter flower
#

you have to first add the minecraft:scale component to the player.json file since it is not there by default

#

it should work after that

#

if it's not working after that, a bug report should probably be made or something

supple minnow
#

is there a way to move the players camera tho

winter flower
#

Not atm no