#1.19.60 update broke so much!?

1 messages · Page 1 of 1 (latest)

quick gate
#

.

rugged tiger
#

.

formal crag
#
world.events.beforeItemUse.subscribe((data) => {
  let { item, source } = data;
  if (item.typeId === "redux:kit_gui") {
    kitsForm(source);
  }
});

function kitsForm(source) {
  let form = new ActionFormData();
  form.title(`Kit Selection`);
  form.body(`\nSelect an available kit\n\n`);
  form.button(`Starter`);
  form.show(source).then((response) => {
    if (response.selection === 0) {
      source.runCommandAsync(`scoreboard players set @s Kit 1`);
      source.runCommandAsync(`structure load starter_kit ~~~`);
    }
  });
}```This is the whole code if anyone wanted it. It used to work perfectly fine before the update and now it doesn't want to do anything. I have the structure saved since I can run the command through chat, it just doesn't want to work this way.
#

i tried to

quick gate
#

ok

#

but this should work

formal crag
#

well it doesn't for some reason :/

#

the scoreboard command functions just fine but not the structure command

quick gate
#

hmm thats weird

formal crag
#

i tried running it on execute to see if that would change anything but still nothing

quick gate
#

try running structure command first

formal crag
#

that seemed to have fixed it, thanks con..
i don't understand why the order would matter here

#

it's honestly a shame we can't give items with enchants 😦
this would make life so much easier

quick gate
#

u can add items with enchantment

hot totem
quick gate
#

use enchantment component on itemStack

hot totem
#

wait

#

it is now exist?

quick gate
#

ya from 1.18.30

hot totem
#

ah.

quick gate
#

xd

hot totem
#

what's the example?

formal crag
quick gate
#
  1. get enchantment component
  2. get enchantments list from component
  3. modify/remove/add enchants what u want
  4. put enchantments list back to enchantment component
  5. put itemStack back to inv slot
formal crag
quick gate
#

maybe Enchantment class if u will add new enchatments to list

formal crag
#

thanks for "the help" i guess

quick gate
#

here is about component

#

thats list is enchantments property on it

formal crag
formal crag
# hot totem what

that's the response you'll get from everyone who can actually understand javascript

hot totem
#

uh

quick gate
# hot totem uh

Every thing what u need now is understand JS and access to documentation (MC Docs)

#

here is about JS

#

? js

glacial valveBOT
#
Learn Javascript!

As the Script API is a framework built on JavaScript code, having an understanding of JavaScript is key.

If you are being shown this, then you most likely are a beginner with JS and could use a little guidance.

📺 Videos on Learning JavaScript
Javascript in 1 hour
Javascript Classes in 1 hour

Web Guide:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide

Reference Sites:
https://www.w3schools.com/jsref/default.asp
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
https://javascript.info

quick gate
#

it helps a lot

#

trust me

hot totem
quick gate
#

? MS docs

glacial valveBOT
hot totem
#

yes

#

the problem is my internet gone wrong

quick gate
#

i actully know all features in MS docs for Script API, only some entity components i doesnt bc there are #1067869022273667152 stuff

quick gate
#

if u dont know if player have function like getName((

#

then just try it and test

#

if it works then player have it

#

if not

#

then no

#

¯_(ツ)_/¯

#

this is how programming is going lol

feral ibex
#

an easy and fast way is

#

make wrappers

#

if you have

#

import * as MC from "@minecraf/server"

#

then change to import * as MC from "./custom"

and in custom.js

#

define all needed things and make them run minecraft functions etc

#

this will save you in future

quick gate
#

🚫

#

This is not solution