#1.19.60 update broke so much!?
1 messages · Page 1 of 1 (latest)
.
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
well it doesn't for some reason :/
the scoreboard command functions just fine but not the structure command
hmm thats weird
i tried running it on execute to see if that would change anything but still nothing
try running structure command first
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
u can add items with enchantment
how?
use enchantment component on itemStack
ya from 1.18.30
ah.
xd
what's the example?
do you have an example piece of code?
this would make like easier if i can just give the players the items with the enchants on it
- get enchantment component
- get enchantments list from component
- modify/remove/add enchants what u want
- put enchantments list back to enchantment component
- put itemStack back to inv slot
what's the required imports for this?
maybe Enchantment class if u will add new enchatments to list
thanks for "the help" i guess
https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/itemenchantscomponent
here is about component
thats list is enchantments property on it
let me guess, if I ask if you could make an example script you'll just scream at me to go learn js 😐
what
that's the response you'll get from everyone who can actually understand javascript
uh
Every thing what u need now is understand JS and access to documentation (MC Docs)
here is about JS
? js
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
i have learned the basics of javascript though
ok, so do u understand MS Docs?
? MS docs
i actully know all features in MS docs for Script API, only some entity components i doesnt bc there are #1067869022273667152 stuff
u can try and test also
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