#Script API General

1 messages ยท Page 46 of 1

distant gulch
#

Make a clickable item with a cool down that runs a command via script

wary edge
#

So whats your code?

distant gulch
#

I'll send an ss brb

distant gulch
dim tusk
#

the event you use doesn't matter, what you are doing inside of the event does

round bone
#

it's O(m*n)

#

it's not always O(n^2)

chilly fractal
#
for (let i = 0; i < inv.size; i++) {
  let item1 = inv.getItem(i), item2 = cachedInv[player.id][i];
}

That code snippet Be like:
"Am i a joke to you?"

chilly fractal
# distant gulch

Personally, i avoid commands and anything in the entity files as much as i possibly can, but effect @s clear i believe is much faster than looping in the whole effects & clearing them, other than that, i have not used one singular command in my whole blissSMP addon, while yes, scriptevent & playSound are commands, these were only for the hit cancelation & stuff

chilly fractal
chilly fractal
round bone
#

using native existing methods instead runCommand

chilly fractal
round bone
#

yeah I know about docs

chilly fractal
#

No no, I'm telling them, you're good.

round bone
#

atm the only things I have to do via commands is /kick

#

most of commands are already implemented or result can be achieved by another way

chilly fractal
chilly fractal
round bone
#

oh yeah

#

my bad xD

remote oyster
#

Converting over to a Map versus an array would speed this up just a little since the lookup time is quicker and it would eliminate the nested loop in your include methods. But aside from that, this is probably about as good as you are gonna get my friend. Unless your use case changes. Then you might be able to adjust the pattern but that's neither here nor there at the moment.

#

That's never the answer to give.

"Forget optimizing your code. Just run it. It doesn't matter".

Lazy reply bro.

#

Even though the loops are written separately, the includes method checks every slot in the other inventory for each item. This makes it equivalent to a nested loop with O(n^2) complexity.

#

And yet you are wrong.

bright dove
#

Lol

winter plaza
#

still, it doesn't work

chilly fractal
winter plaza
#

wait 5 minute

#
[Scripting][error]-TypeError: cannot read property 'damage' of null    at projetil (wg/commands.js:51)
    at <anonymous> (main.js:60)
chilly fractal
#

And show me these lines

#

Show me line 51 only, actually.

#

Show me the line above it, and itself & the one below it.

winter plaza
chilly fractal
#

So it means

#

You are accessing damage of null

#

Teste is null unless the entity has that propery, according to your tenary operator

#

And logging the property damage of teste (which is null) will throw an error

#

Because that property does not exist.

winter plaza
#

but the entity has the property "wesl3y:jutsu" equal to "fire_ball"

chilly fractal
#

Try logging the teste variable. (Only, dont log damage or other things so it doesn't throw an error)

winter plaza
#

like this?

chilly fractal
#

Use console.error(teste);

chilly fractal
#

It probably doesn't have the fire_ball property

winter plaza
#

I don't know what I did, but now it works, thanks.

chilly fractal
#

You're welcome.

unique acorn
#

since player.removeLevel() doesnt exist, any ideas?

chilly fractal
#

.addLevel(-7); //removes 7 levels

#

Same with scoreboard. Add negative score.

unique acorn
#

thanks

chilly fractal
#

You're welcome.

verbal slate
#

It writes this error and does not open UI what to do?

chilly fractal
#

Show me your manifest.json

verbal slate
chilly fractal
#

What version are you on?

verbal slate
chilly fractal
#

Huh

warm mason
chilly fractal
warm mason
#

You just enabled messages from the "information" level debugger

chilly fractal
#

Ah

warm mason
verbal slate
warm mason
verbal slate
#

Yes

warm mason
verbal slate
#

Okay thanks for your help

quick shoal
#

Or is there anyway to customize code colour and autosuggest in Mt manager?

quick shoal
verbal slate
quick shoal
verbal slate
quick shoal
#

@verbal slate

distant gulch
#

I still haven't gotten an answer why isnt my item working ๐Ÿ˜ญ

quick shoal
#

I do not have a theme option

verbal slate
quick shoal
quick shoal
distant gulch
quick shoal
#

Here is how to use the bot

distant gulch
#

I can't the code is on my PC and I'm on my phone

quick shoal
#

Also I can just help U when I have time not atm

quick shoal
distant gulch
#

It's a Chromebook

verbal slate
quick shoal
#

Maybe I'm not updated my Mt manager yet

verbal slate
quick shoal
verbal slate
#

I downloaded it from the site, but it's not in my Google Play Store

steady canopy
steady canopy
#

why u typing so much bro it's not that deep

remote oyster
# steady canopy i didn't say anything where i can be wrong ๐Ÿคทโ€โ™‚๏ธ

You affirmed Nanopoison's response when he tried to correct Asteroid about the complexity in y'alls discussion.

I replied to them explaining that the complexity was in fact just that due to the usage of the includes method and then proceeded to correct you. Asteroid knew what they were talking about but you both tried to tell the person otherwise.

I spoke up because I saw the blind leading the blind and there is nothing productive in that.

steady canopy
remote oyster
steady canopy
#

Bro i'm a software engineer with a degree how come i can be a "blind leading a blind". I'm not like 99% devs here that are just kids trying to learn javascript to create addons for their servers.

steady canopy
#

That's why i said that

#

you look like a non-native speaker

remote oyster
steady canopy
#

it's not a problem tho it was a good try

remote oyster
#

Don't act intellectual. Either you are or you aren't. If you make a mistake, then own it. Bro got their ego damaged and wants to fight about it.

steady canopy
#

but

#

Asteroid isn't right

remote oyster
steady canopy
#

but alr whatever u say

remote oyster
#

I care when chumps like you who come in here yapping like they know a thing or two, but really don't.

steady canopy
#

You don't have a software engineering degree

#

so

#

ig some1 should shut up

remote oyster
#

You have no idea what I do ๐Ÿ˜†

steady canopy
#

I guess it's obvious

#

You shouldn't be more than 19yo

#

you talk like a kiddo

remote oyster
#

Dream your dreams ๐Ÿ‘

steady canopy
#

ok

turbid delta
#

Way simplier

chilly fractal
chilly fractal
#

Less work on the device that runs the code

turbid delta
#

So I can find out how much changed so I can log it....

#

You are very picky about solutions ๐Ÿ˜ญ

chilly fractal
#

You want performant stuff bruh

#

I'm telling you the most performant methods fr

keen laurel
#

what I'm saying is the solution he SHOULD have had is not O(n^2) sorry

dim tusk
#

Two adults fighting over English and a js? You just got corrected and you got mad? Damn

remote oyster
keen laurel
#

To be fair I didn't explain it the best haha. I was just trying to explain to him that he didn't need two loops if he wanted to validate if they were equivalent inventories

remote oyster
#

No worries. I appreciate you clearing that up for me.

steady canopy
remote oyster
#

I already looked you up with your ID. I'm not impressed kid.

steady canopy
#

i already looked you up with your ID? ๐Ÿ˜ญ

#

wtf is bro talking about

remote oyster
#

I suppose you aren't as bright as you claim.

steady canopy
#

Think whatever u wanna think

#

i didnt study years to get a software engineering degree for a kid to tell me im not what i claim to be

remote oyster
#

I believe this should be continued in #off-topic . Otherwise I'm moving on.

steady canopy
#

i dont care about this conversation so im just leaving

keen laurel
# steady canopy "Missunderstanding"

It was easily misunderstandable, we got it cleared up. Not that big of a deal bro, you were trying to defend what I said but you just got an ego trip for some reason lol.

#

What visual impact said was inherently correct because my wording was bad and made it sound like I was just correcting him on his big o notation

steady canopy
#

k

#

You must be dumb to missunderstand that but alr

#

wtv u say

remote oyster
steady canopy
#

who the hell does this guy think he is

#

oh no im so afraid of a random!

#

let's chill out

warm mason
#

๐Ÿฟ ๐Ÿ‘€

remote oyster
steady canopy
#

Hell nah

#

i was already out of this conversation tho

#

why u bringing it back

steady canopy
#

someone staying mad

remote oyster
#

The only one upset is the one raging with the comments. I'm at work, and chill right now. Where is your mindset?

#

I do wish Discord offered a better method for blocking people versus "hiding" their comments.

round bone
#

I mean, they're not required in this case but I feel so weird when I don't see them

keen laurel
round bone
#

coding on phone is such a pain

keen laurel
#

yea I don't understand how people unironically do it

keen laurel
#

I did it bcz I was too lazy to do it on a computer

turbid delta
#

Using brackets on one liners is my pet peeve personaly

round bone
#

I mean, yeah, but it feels pretty weird if you have this nested like that

remote oyster
keen laurel
#

same, but tbh I probably needed more than just equivalent for it to work lmao

round bone
#

xD

round bone
#

also harder to use types inside enviroment

steady canopy
round bone
#
  • running it all is much slower
keen laurel
#

nah no brackets is great dont hate

#

as long as u don't move it all on one line lmao

remote oyster
#

I've been using brackets for so many years that I actually find it unnatural when doing it with JS. I have exercised with it some, to try and loosen up. Still looks weird to me.

#

Personal preference on how people cope lol.

distant tulip
#

if(x) {return}
this feel like a crime

keen laurel
#

all I'm saying is if I had to start every function with

if (!a) {
    return;
}
if (!b) {
    return;
}

I would probably be less happy of an individual

#

obviously a simple case here where I could've done an && but still

dim tusk
#

that looks cursed as hell

keen laurel
#

that's what I'm saying

#
if (!a) return;

is just so much superior in my eyes lmao

thorn flicker
#

would be probably easier to read

distant tulip
#

i am confused where this discussion started lol

thorn flicker
dim tusk
#

Tho it still depends on situation

thorn flicker
#

I code like that though

distant tulip
keen laurel
#

it's only ok for objects imo

dim tusk
keen laurel
#

wtf

#

idk why that's even more cursed to me ๐Ÿ˜ญ

thorn flicker
#

else if?

keen laurel
#

yeah for returns

thorn flicker
#

how is that cursed

dim tusk
keen laurel
#

not in general, but the

if (!a) {
  return;
} else if (!b) {
  return;
}
#

that feels even worse some how

thorn flicker
#
if (!a) {
  return;
} 
else if (!b) {
  return;
}
keen laurel
#

omg

thorn flicker
#

thats how I write it

#

lmao

keen laurel
#

nah this not sitting right with my ocd or whatever i have

warm mason
thorn flicker
keen laurel
#

yeah the example was simplified, but some cases u can't do that

dim tusk
thorn flicker
#

so idc

keen laurel
#

I mean in certain return statements if I need more than just return I will obviously use brackets slol

#

like if I need to send a warning or smth

distant tulip
#

bao_bee_happy

a || (b || (() => {})());
keen laurel
#
server.system.afterEvents.scriptEventReceive.subscribe((event) => {
    if (event.sourceEntity.typeId !== "minecraft:player") return;
    if (event.id !== "test:test") return;

    // conditions met
});

but for events like this, imo this is just too nice to pass up (random example lol)

thorn flicker
#
if (whatever) {
return {    } 
}
#

lol

autumn seal
#

10/10 readability

dim tusk
#
system.afterEvents.scriptEventReceive.subscribe((event) => {
    if (event.sourceEntity.typeId === "minecraft:player") {
        if (event.id === "test:test") {
             // code
        }
    }
});
#

I prefer doing this.

distant tulip
thorn flicker
keen laurel
#

you guys like nested code like that

#

sad :(

thorn flicker
#

preference

keen laurel
keen laurel
#

imagine LMAO

dim tusk
thorn flicker
autumn seal
#

Who needs encryption when your code looks like that

dim tusk
keen laurel
thorn flicker
#

only write in ternary

dim tusk
#

you see that programming language that you write with whitespace only?

autumn seal
#

Personally I name all my variables after mozart compositions

tidal wasp
#

Can setType be used to place/replace blocks

unique dragon
#

anyone know if it's possible to add infinite time to effects with addEffect method?

autumn seal
thorn flicker
keen laurel
dim tusk
unique dragon
#

lol

thorn flicker
dim tusk
autumn seal
unique dragon
keen laurel
#

that is fair

dim tusk
unique dragon
#

ik

thorn flicker
keen laurel
#

yeah but no intellisense :(

thorn flicker
#

just a simple line

keen laurel
#

still forgot a } lol

unique dragon
#

I just realized that is not possible to hide particles if you use infinite time

thorn flicker
#

cant even type it correctly

thorn flicker
#

are you sure

#

that sounds dumb

dim tusk
#

it works perfectly fine with me.

unique dragon
#

oh yeah omg, i forgot the amplifier

#

lmao

thorn flicker
thorn flicker
keen laurel
#
if (1) if (2) if (3) if (4) if (5) if (6) if (7) if (8) if (9) return 5; else return 2; else return 7; else return 1; else return 8; else return 4; else return 9; else return 6; else return 3;

least confusing statement

keen laurel
#

so you have to!

unique dragon
#

โ˜ ๏ธ

dim tusk
keen laurel
#

obviously if 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 but not 9 you return 2, not 8

thorn flicker
#

forEach or for loop

dim tusk
# keen laurel the returns are not one-to-one
const conditions = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const returns = [3, 6, 9, 4, 8, 1, 7, 2, 5];

return conditions.findIndex(c => !c) === -1 ? returns[conditions.length - 1] : returns[conditions.findIndex(c => !c)];

keen laurel
#

yeah but that's not one line

thorn flicker
#
const conditions = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const returns = [3, 6, 9, 4, 8, 1, 7, 2, 5];

for (let i = 0; i < conditions.length; i++) { if (!conditions[i]) { return returns[i]; }} return returns[conditions.length - 1];
dim tusk
dim tusk
#

I'm not talking about one lining it

dim tusk
#

My learnings about for loop, indexes, for of pays off... rahhh

remote oyster
#

Interesting read lol

keen laurel
remote oyster
#

Everyone is enjoying their culture I see lol.

#

Still getting used to not using brackets. I might be old fashioned when it comes to that. ๐Ÿ˜…

dim tusk
# thorn flicker perfect

Wait... even simpler?

return [3, 6, 9, 4, 8, 1, 7, 2, 5][[1, 2, 3, 4, 5, 6, 7, 8, 9].findIndex(c => !c) || 9 - 1];

-# If I'm gonna be honest with you, I literally need to search for stack overflow lmao

round bone
round bone
#

a bit faster

#

hold up wait

keen laurel
#

mine runs faster

dim tusk
round bone
sharp elbow
round bone
#

you got me such a nice headache xD

keen laurel
dim tusk
distant tulip
distant tulip
#

yeah

keen laurel
#

it would also always do the same thing

dim tusk
#

I waste my time searching stack overflow when I have a deadline for my thesis

round bone
#

do you all have some sort of competition to confuse some people like me while making fun of javascript?

keen laurel
#

I was just making cursed code idk

distant tulip
#

same

round bone
sharp elbow
#

Are the numbers here literal? Or just placeholders for other conditions

wheat condor
keen laurel
dim tusk
sharp elbow
#

... So this is equivalent:

function findValue(i) {
  return 5;
}
round bone
#

the art of javascript is to type in terminal npm install -g typescript and npx tsc init

distant tulip
#

findIndex ๐Ÿคข

keen laurel
#

we got there eventually

dim tusk
#

Nvm the thesis deadline is tomorrow, so I'll do it tomorrow

#

Due tomorrow, do tomorrow

distant tulip
#

deadline is in 2h so i will do it the next hour

sharp elbow
#

At least do some of it now, like 1/3 of it, you will thank yourself later

dim tusk
round bone
#

oh yeah you have role xD

thorn flicker
round bone
#

I just wasn't sure it was him

iron coral
#

Does anyone know if there is a molang function to prevent the animated object from touching the floor?

warm mason
#

#1067869022273667152

iron coral
#

i know

thorn flicker
#

why are you asking here then

warm mason
#

And why are you writing this here?

iron coral
#

But there is no one active on the molang channel

#

๐Ÿ˜ฆ

warm mason
#

...........

thorn flicker
#

ive heard this type of reasoning before

#

in this channel

#

lol

#

be patient.

warm mason
iron coral
#

But I have nothing to do if the molang channel is dead

thorn flicker
warm mason
#

Then figure it out for yourself, we have scripts here

thorn flicker
#

there's a molang channel

warm mason
thorn flicker
dim tusk
#

I kinda forget that molang channel existed

thorn flicker
#

me too.

iron coral
warm mason
thorn flicker
#

anyway

dim tusk
#

Ask in #1067869318383157430 (but you said it's dead) or in #1067869590400544869 instead

warm mason
#

#add-ons

thorn flicker
#

@dim tusk @warm mason

#

a little problem.

warm mason
#

I'm just saying what the options are

remote oyster
dull shell
#

is there anyway to compress these ?

#

like this

#

the money

tawny reef
#

can i get help for my manifest.json
{
"format_version": 2,
"header": {
"name": "ElysiumMinage",
"description": "ElysiumMinage Script Pack",
"uuid": "7983f147-4ba9-4b0e-81b6-08202c43b8b1",
"version": [1, 0, 0],
"min_engine_version": [1, 20, 0]
},
"metadata": {
"authors": ["shadowbubble"],
"generated_with": {
"blockbench_item_wizard": ["1.1.0"],
"blockbench_block_wizard": ["1.2.2"]
}
},
"modules": [
{
"type": "script",
"entry": "scripts/main.js",
"uuid": "072153b0-0716-43a7-9ebe-1118953fe17e",
"version": [0, 1, 0]
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.21.51"
},
{
"module_name": "@minecraft/server-ui",
"version": "1.21.51"
}
]
}

dim tusk
dim tusk
dull shell
#

for example

Frost Bite
$1.3K
INSTEAD OF
Frost Bite
$1300

dim tusk
dull shell
#

yes

dim tusk
#
function formatCurrency(amount) {
   return `${(amount / 1000).toFixed(1)}K`;
}```
dull shell
#

im using that score tho to find if the player has the correct amount

keen laurel
#

Then you can't shorten it? You'll be losing data (specifically the last 2 digits) if you compress it

#

You need to use some other method of storing their currency

#

to achieve that effect

dull shell
#

okay thank you for that!

#

when a player hits a entity how can I run a command on the entity hit if that players has a score

dim tusk
keen laurel
ocean escarp
dim tusk
#

did you read my message?

#

the display doesn't interfere with the original value he still can get the original value

keen laurel
#

oh wait theres two values to a scoreboard?

#

my bad lol i guess i missed something

dim tusk
dim tusk
keen laurel
#

Oh wait I missed the original context, I thought he was asking about making the scoreboard value 1.3k instead of 1300

#

Not showing it on UI

steady canopy
# dull shell like this
export const metricNumbers = (value: number): number | string => {
    const types = ["", "k", "M", "B", "T", "P", "E", "Z", "Y"], selectType = Math.log10(value) / 3 | 0;
    if(selectType == 0) return value;
    let scaled = value / Math.pow(10, selectType * 3);
    return scaled.toFixed(1) + types[selectType];
}
keen laurel
#

uhhh

#

Petadollars lmao

dim tusk
keen laurel
#

Yeah I read context above it but the real important one was behind a massive wall of code and didn't realize it lmfao

steady canopy
keen laurel
#

yeah but u have it listed as P in types

steady canopy
#

Yeah peta can be also used

dull shell
#

so just throw this in and my scores that are displayed will be compressed?

keen laurel
#

interesting I have never seen nor heard of P instead of Q

steady canopy
#

just do metricNumbers(number)

#

metricNumbers(2000000) -> 2.0M

dim tusk
dull shell
dull shell
#

im still geting some errors

dim tusk
# dull shell im still geting some errors
function metricNumbers(value) {
    const types = ["", "k", "M", "B", "T", "P", "E", "Z", "Y"];
    const exponent = Math.floor(Math.log10(value));
    const selectType = Math.min(Math.floor(exponent / 3), types.length - 1);
    
    return value < 1000 ? value.toString() : `${(value / Math.pow(10, selectType * 3)).toFixed(1)}${types[selectType]}`;
}```
#

That is typescript here's the javascript

dull shell
#

okay so i added it into my code with 0 errors

#

but its not displaying the scores compressed

#

do I have to change something in there to myt scoreboard?

dim tusk
#

Like this.

dull shell
#

okay thank you! its working now but some of my other js isnt working

#

my sidebar stopped popping up

dim tusk
#

No errors?

dull shell
#

nope

chilly fractal
steady canopy
chilly fractal
#

See what i said?

steady canopy
#

no i dont

#

womp womp

chilly fractal
#

Mad as shit and ego is high as it.

steady canopy
#

mad just because u say it

#

hell nah

#

cry about it

chilly fractal
#

I could go on to argue with a dumbass high ego 13 year old thinking he is better than everyone. But no i haven't gotten good sleep this month and its 2:37am. So i dont have the fucking power to argue with you.

chilly fractal
#

I'm greatful not to be in your place. I'm greatful i dont have high ego that blinds me from seeing bugs or errors and hating feedback or anyone that doesn't agree with me. Basically I'm greatful i dont mind people having opinions, unlike you. Now if you wish to keep fucking yourself, go ahead. I had a shitty day and i have had a shitty sleep schedule this month and i ain't gonna continue this useless conversation with someone who is Basically Blind, but the only difference is, they chose to be blind, and not forced to be blind.

wary edge
#

Scripters being toxic once again... sigh

thorn flicker
dim tusk
#

This is mad crazy.

keen laurel
#

It's always the programming communities for kids too lmao. I rarely see this toxicity in modding, library servers or open source projects

autumn seal
#

Personally I've seen this toxicity in any server that includes coding just in different levels

#

Hopefully no one has any opinions of if chatSend is a viable workaround for commands

nimble schooner
#

How do some people display blocks or items above the crate after it has been opened?

#

Do they use particles?

keen laurel
neat hazel
#

What's the error?
Error:

[Scripting][error]-TypeError: not a function at <anonymous> (chakra.orb.js:23)

Code:

mc.system.runInterval(() => {
  for (const dimensions of ['overworld', 'the_end', 'nether']) {
    const dimension = mc.world.getDimension(dimensions);
    const entities = dimension.getEntities({ type: "shin:chakra_orb" });
    const players = mc.world.getPlayers();
    for (const entity of entities) {
      for (const player of players) {
        const playerPos = player.location;
        const orbPos = entity.location;
        const distance = Math.sqrt(
          Math.pow(playerPos.x - orbPos.x, 2) +
          Math.pow(playerPos.y - orbPos.y, 2) +
          Math.pow(playerPos.z - orbPos.z, 2)
        );

        if (distance <= 5) {
          const dx = (playerPos.x - orbPos.x) * 0.2;
          const dy = (playerPos.y + 1 - orbPos.y) * 0.2;
          const dz = (playerPos.z - orbPos.z) * 0.2;

`LINE 23 -->` entity.setVelocity({ x: dx, y: dy, z: dz });
        }
      }
    }
  }
}, 1);
quick shoal
#

@neat hazel see last error

autumn seal
#

setVelocity? Have you tried applyImpulse

quick shoal
keen laurel
#

yeah setVelocity doesn't seem to be a real thing?

neat hazel
neat hazel
neat hazel
celest abyss
#

How do I make a command run until the player no longer has a tag?

#

That means that if a player gets a tag, a command is being executed repeatedly until he no longer has it.

keen laurel
#

Here are two simple ways that I would do it (I would probably would use the first)

  1. Use a map and store players who have the tag (you can store it when u add the tag), run command on all players in the map every tick, and check them if the tag has been removed (or remove them from the map when u delete the tag).

  2. Every tick check every player for if they have the tag or not, then run the command on them

celest abyss
keen laurel
#

Yes you would do that with a script

dim tusk
#

Is this what you mean or nah?

sharp elbow
#

If this is the case, just use tick.json and a Minecraft function.
BP/functions/loop.mcfunction

execute if entity @a[tag=test] run <command>

BP/functions/tick.json

{
  "values": [
    "loop"
  ]
}
slim spear
celest abyss
sharp elbow
#

Not sure I understand. Do you need the command to execute once, if the player has the tag?

#

So it will not repeatedly execute if a player has that tag?

true isle
#

has anyone tried to recreate a chorus flower ?

#

or the plant itself

true isle
#

loop meaning untill the tag is gone

#

or something else overrides that

slim spear
celest abyss
#

Now I need to detect if the item is still there and if it is no longer there, the tag should be added again.

nimble schooner
#

How do some people display blocks or items above the crate after it has been opened?

autumn seal
#

I would guess using entities or using a fox with a item in its mouth to get something akin to block displays that java has

autumn seal
#

That's what I was referring to when saying using entities but I quickly looked through the discord and saw someone mention using a method with a fox

#

But yes I would just use a custom entity over anything like that you are right

dim tusk
#

I mean it also depends

#

If this is pure commands either use fox or armor stand

#

But if it's an addon just create custom entities..m why bother

dim tusk
# autumn seal

I checked the videos on the post and it's kinda scuffed imo

autumn seal
#

I definitely can't disagree

uncut mason
#

There is, in fact, a way to programmatically set an item frame's contents, or fake it at least, but it's super jank.

You can pre-generate an mcstructure file for every item in the game (1 file for each permutation of item, item rotation, frame facing direction), and pair it with StructureManager to place.

The disk usage and subsequent add-on load time... oof! Like I said, super jank.

Needless to say, this really shouldn't be done, but if you're going to do it anyway, keep it server side.

Ask me how I know!

dim tusk
uncut mason
shut vessel
#

How to make a double hit anti ?

quick shoal
#

Like give player a state

#

And set a timeout that remove state

#

If a player is hit with state then represents that player already hitted

#

Make some functions when detected second hit and also remove the state

abstract cave
#

How do i remove an item from player inventory using script

winter pumice
abstract cave
#

ty

abstract cave
sage hamlet
#

How do I actually use the event in script since it doesnt follow the common world.after/beforeEvents....subscribe logic

abstract cave
chilly fractal
sage sparrow
#

hi there, do someone know if the cap of 256 buttons also apply for modal forms? like text fields or dropdowns?

chilly fractal
#

Probably

cinder shadow
#

has anyone managed to get interacts to work on flowing water?

keen laurel
#

Not sure if I misunderstood though

cinder shadow
#

guess the answers no, that doesn't work lol

keen laurel
dim tusk
keen laurel
#

Or I guess he implied it didn't work

dim tusk
#

Nvm

cinder shadow
#

itemUseOn will only let you get "minecraft:water"

dim tusk
#

flowing water? Nope not possible

cinder shadow
#

blockFromRay for whatever reason does not get flowing water

dim tusk
keen laurel
#

really was hoping block from ray would work lmao

dim tusk
#

there's liquid option right?

#

Yeah there is... includeLiquidBlocks

wary edge
keen laurel
dim tusk
#

-# random

keen laurel
#

My guess if includeLiquid doesn't work is that it might just be a collision box that doesn't work with rays

cinder shadow
#

even if it were to detect flowing water

loud brook
#

Hi guys, How do I declare the block type in the function getBlocks?
(I believe I did it wrong in the following code since it returns unidentified.)
I checked the website to look for an example but couldn't find

const volume = new BlockVolume({x: block.location.x + 2, y: block.location.y + 1, z: block.location.z + 2},{x: block.location.x - 2, y: block.location.y - 1, z: block.location.z - 2});
            const btarget = block.dimension.getBlocks(volume, { BlockPermutation: { type: "brs:batimcycle_generatorswitch" } })
rough vine
loud brook
rough vine
loud brook
wheat condor
#

#1322880895656525856 can someone help ?

warm mason
# shut citrus how to make this with scripting?

Same thing as asking โ€œhow to create the same addon as X modโ€. This is a fairly large project, so there is no answer to your question. And itโ€™s unlikely that anyone will write the code for you, if only because it will take weeks, or even months.

onyx lantern
#

guys, how much lag does ticking cause? is it very bad?

how about systemRunInterval is it any better?

remote oyster
onyx lantern
#

I've a title bar that calcs the TPS to see if it's causing lag but it doesn't really matter what I do it always stays at a value between 19-21, is it really that hard to cause server lag on bedrock? because I see people talking about lag caused by ticking but when I try to replicate placing or generating a lot of blocks that tick, the TPS value doesn't go UP

onyx lantern
remote oyster
# onyx lantern could you elaborate, please?

Code executes synchronously if not specifically setup to be asynchronous. So line by line your code inside the loop executes. The lag you are asking about between each loop will be dependent on the lines of code being executed and the time it takes to execute them.

onyx lantern
#

another thing: Is there anyway I could make so breaking the top part of a custom double plant instantly or at least almost instantly breaks the bottom part of the double plant? because currently everything I tried resulted in a little delay but I'm also not sure if that's it and there's nothing I could do about this

untold magnet
#

i think, there's no way to make custom heads placeable like vanilla heads without using scripts to rotate the custom head right?

knotty plaza
onyx lantern
onyx lantern
untold magnet
open urchin
untold magnet
remote oyster
# onyx lantern what are the advantages for MC too make code asynchronous?

A lot of advantages. By offloading tasks to asynchronous operations, the main game loop running on the primary single core can run more efficiently. This is particularly useful for tasks that involve I/O operations, network requests, or other time-consuming processes. Asynchronous code allows the server to continue processing other tasks while waiting for an asynchronous operation to complete. This prevents the server from being blocked by long-running tasks if implemented and managed correctly.

untold magnet
untold magnet
onyx lantern
onyx lantern
warm mason
onyx lantern
onyx lantern
#

if its better

warm mason
#

Asynchrony is needed for complex tasks, and it essentially just divides them into small synchronous tasks

wheat condor
#

#1322880895656525856 can someone help me?

untold magnet
onyx lantern
remote oyster
onyx lantern
warm mason
#
system.runInterval((async function() {
// code
await system.waitTicks(1)
// code
}), 3)
remote oyster
# onyx lantern how?

Another example:

import { system } from "@minecraft/server";

async function performAsyncTask() {
    // Simulate a delay to represent an asynchronous task (e.g., fetching data)
    await new Promise(resolve => setTimeout(resolve, 2000));
    console.log("Asynchronous task completed");
}

function scheduledTask() {
    console.log("Scheduled task started");

    // Call the asynchronous function
    performAsyncTask().then(() => {
        console.log("Scheduled task completed");
    });
}

// Schedule the task to run every 100 ticks (5 seconds)
system.runInterval(scheduledTask, 100);
warm mason
#

Donโ€™t forget that asynchrony is only needed in resource-intensive code. For example, if you just need to scan the inventory of one player, then asynchrony is not very necessary

onyx lantern
#

how about a function that gets executed every tick?

#

to detect if a player is in contact with a block to then cause damage (a cactus, for example)

warm mason
onyx lantern
#

async or sync?

warm mason
#

And it would be nice if you showed the code, it will be easier to understand how to optimize it

onyx lantern
#

it currently looks bad because I was messing a lot with it to test a few things but wait a second, I'll grab it

shut citrus
onyx lantern
# onyx lantern

I removed the part that checks if the block has a specific tag while I was testing but I'll add that back once I get the thing that detects which axis is the block in front of the player to work properly

warm mason
# onyx lantern

The code doesn't look complicated, but it can be made asynchronous by putting this instead of runInterval:

const playerPerTick = 1
async function asyncInterval() {
  for (let i = 0; i < world.getAllPLayers().length; i++) {
    climb(world.getAllPlayers()[i])
    if (i % playerPerTick == 0) await system.waitTicks(1)
  }
  asyncInterval()
}
#

The more playerPerTick the more operations will be performed synchronously, you need to configure this so that the time for a synchronous operation is approximately 30 MS

onyx lantern
#

also thank you very much!

warm mason
# onyx lantern how can I calculate the time for a sync operation?

record the time before executing the climb function (let time = new Date().getTime()) and after executing this function. The difference will be = time after execution - time before execution. Then 30/time difference and round that number down, putting the final value in playerPerTick.

onyx lantern
#

btw, do you know if there's a better way I could make the player stay still in the air? I'm currently using knockback but idk if there's a better way

inland merlin
#

if that works.. i haven't really tried to disable player physics etc.

#

component groups*

#

maybe based on a tag...

neat hazel
#

Is it possible to clear the inventory on only items with a specific tag?

wheat condor
#
if (inv.getItem(slot).hasTag('your tag')) {
  inv.setItem(slot,null)
}
wheat condor
neat hazel
distant tulip
#

item tags are not dynamic

wheat condor
#
inv.setItem(slot,item)
#

serty what?!\

warm mason
distant tulip
#

item tags != entity tags

wheat condor
#

i mean if you add a tag you have to replace it no? like lore

warm mason
#

Tags for items and blocks can only be set in json

distant tulip
#

those are item tags
script api can't edit them

wheat condor
#

๐Ÿง  โŒ

distant tulip
#

use lore or dynamic property

neat hazel
wheat condor
warm mason
distant tulip
#

hasTag
but as i said the tag here is not what you are thinking

wheat condor
distant tulip
#

not all tools/devices offer that

mystic bluff
#

Anyone who has a script to check someone his inventory and enderchest

warm mason
dim tusk
#
const chessboardPlains = [];
for (let row = 0; row < 8; row++) for (let col = 0; col < 8; col++) chessboardPlains.push({ origin: [col * 2, row * 2], size: [2, 2], name: `${String.fromCharCode(65 + col)}${8 - row}`, });```
#

Should I store it as a map instead of an object?

#

-# ignore the one lining...

rough vine
distant tulip
dim tusk
#

I'll retain it as objects

#

I just use it once lmao

mystic bluff
#

Is there a script that stops a player from hitting another player

true isle
keen laurel
#

Is the correct method for storing player statistics scoreboards, dynamic properties, or something else?

#

Like I want 10+ statistics

meager cargo
#

I have question, does anyone can help me? I started using ChestFormUI and I have issue iwth latest "durability" idea in the script. Even if there is no durability set in button there is this 'dur#00' text. How can I get rid of it?

Also I found out that typeIDs are not working for me (in Edu), someone had this issue too?

rough vine
meager cargo
#

I should then make function to get rid of the text, right?

meager cargo
#

Oki, thanks!

rough vine
meager cargo
#

I found string of this durability part dur#${Math.min(Math.max(data?.durability, 0) || 0, 99).toString().padStart(2, '0')}
So I removed that from main script and it worked

#

But thanks for trying tho

meager cargo
#

How change this

   title(text) {
       this.#titleText += text;
       return this;
   }```

To the exported title text from rawtext? Like in ActionForm (this still is question for ChestFormUI code)
#

example: I would like to make this working in ChestFormUI: .title({ rawtext: [{ translate: 'main_menu.title', "with": ["\n"] }] })

distant gulch
#

That's my bling

cold grove
#

Should i store some player data in cache with some type of collection like Map, or should i just retrieve the dynamic property when i need it and work with an array? ๐Ÿ‘€

somber echo
#

I need an idea, what do you think is the best way to simulate players tied by their feet to each other?
I appreciate the suggestions

inland merlin
# somber echo

Maybe try playing with the newer input permissions, and teleport them facing the same direction, and make both of those players input effect which way they both get knockbacked sideways forward backwards etc..

#

Or have them both ride something with 2 seats and add input permissions to control that entity they are sitting in

dim tusk
#

Yeah, we could detect WASD... But it's beta rn

distant tulip
#

is it?

dim tusk
#

That's why I said beta

#

wadahel

distant tulip
#

i was asking
not sure my self

dim tusk
#

ohh ๐Ÿ˜ฎ...

#

It's still not stable in .24?

distant tulip
#

stable in preview

#

so...
disable input
check input vector
if the tow are moving in the same direction move them together

dim tusk
#

Update here we go

shut citrus
#

just laugh at it

dim tusk
#

Ohh the spider leg

dusky pulsar
#

the message below it

dim tusk
dim tusk
dusky pulsar
#

๐Ÿ˜ƒ

dim tusk
keen laurel
#

my understanding is that you can use multiple entities acting as bones for IK to make it work, but I could be wrong

#

Not the most trivial task that's for sure

shut citrus
#

so bad

#

mojang don't even add any big feature for rp

dim tusk
keen laurel
dusky pulsar
past blaze
warm drum
#

Erm

valid ice
#

My God, itโ€™s Mr. Script API himself

warm drum
#

the block help section is so dead

valid ice
warm drum
valid ice
#

I donโ€™t do block stuff

#

Sowwy ๐Ÿฅบ

wary edge
#

@warm drum Use the proper channels please.

dim tusk
valid ice
#

๐Ÿ˜

dim tusk
tight plume
#

alright bro put down the phone

dim tusk
cold shoal
#

There's no limit on the number of dynamic properties right? (Just the value stored ? ? ?)

cold shoal
#

thanks!

rapid wren
#

wtf does this mean

dull shell
#

system.runInterval(()=>{
    let property = "jay:health_upgrade";
    let player = "player"
    for (let entity of world.getDimension("overworld").getEntities()) {
      if (entity.typeId === "jay:health_upgrade") {
          let dynamicProperty = entity.getDynamicProperty(property);
          if (dynamicProperty === undefined) {
              entity.setDynamicProperty(property, world.scoreboard.getObjective('HealthCost').getScore(player))
          } else 
          if (dynamicProperty > 0) {
              entity.setDynamicProperty(property, dynamicProperty - 1);
          }
  
          entity.nameTag = `ยงa$${entity.getDynamicProperty(property)}`
      }
    }
  }, 20)
slow walrus
# rapid wren wtf does this mean

it means exactly what it says. server-ui 1.4.0-beta is requesting server 1.17.0-beta, but you have 1.16.0 in your manifest, so it's promoting the version up to 1.17.0-beta

#

so if you wanna get rid of it, then change your @minecraft/server version in your manifest to 1.17.0-beta

rapid wren
#

i already have 1.17 in it

slow walrus
#

well it looks like you have multiple of the same addon enabled somehow,

#

make sure the other ones are removed or fixed

chilly fractal
#

I have been coding for around 10 hours straight now trying to get my stupid indexedDB to work so i can store images and jwt and other stuff in it and its hard to do this & encrypt & decrypt it at the same time... and i just randomly remembered an error in my custom commands script and i decided to see if it was an actual error and it was an error i had no idea about and i fixed... without even seeing the script i knew there was an error on a certain line and certain column ๐Ÿ’€

chilly fractal
subtle cove
#

Above normal, I'd say

chilly fractal
#

I didn't even know what the error was

subtle cove
chilly fractal
#

Wha?

subtle cove
#

Like remembering a word from a conversation yrs ago

chilly fractal
#

So is that some kind of syndrome or great memory or what exactly?... (I'm asking you (a software engineer) a doctor's question... lol)

subtle cove
#

Uhm, I see it as "cool weird network"

distant tulip
chilly fractal
#

Welp ig its cool lol

#

Btw does anyone have a working example of retrieving a value from an indexedDB?

distant tulip
#

indexedDB?

chilly fractal
#

Nah

#

Its kinda like sql

#

Its relatation

#

But its like

#

One sec

subtle cove
#

just make a class for db management...

chilly fractal
#

Yeah thats the thing

#

It doesn't work lmao

#

Basically it does work but uhh it show null when i retrieve

chilly fractal
#

I can't believe i forgor about it

#

if (!entity.isValid()) return;

chilly fractal
#

You're welcome.

mystic bluff
#

Does anyone know how to make it so if i have the tag Owner for example it puts this above my head

[Owner]

dim tusk
#

tho changing the name tag of the player doesn't affect the chat so you'll use another even listener for that

loud brook
loud brook
dim tusk
#

True, just do (player.hasTag()) or (!player.hasTag())

loud brook
mystic bluff
dim tusk
untold magnet
wheat condor
#

is it possible to cahnge the biome of a specified area like in java?

wheat condor
#

like i want to create seasons for my addon

dim tusk
#

Guys... I'm kinda confused with this one.

world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry }) => {
    blockComponentRegistry.registerCustomComponent('chess:board', {
        onPlace({ block, previousBlock, dimension }) {
            if (previousBlock.type.id !== 'chess:board') world.setDynamicProperty(`chessBoard:${dimension.id}:${block.location.x},${block.location.y},${block.location.z}`, initialChessPieces); <-- line 117
        }
    });
});```

```[Scripting][error]-TypeError: Native variant type conversion failed. Interface property ['z'] expected type: number (failed parsing interface to Function argument [1])    at onPlace (main.js:117)```
chilly fractal
#

Try doing console.error(block.location); & console.error(block.location.x); & console.error(typeof block.location.z);

dim tusk
chilly fractal
dim tusk
#

what? As I said when logging it doesn't throw an error but when I put it as the name of dynamic property

chilly fractal
#

Me personally i do:

let blockKey = `${block.dimension.id}|${Object.values(block.location).reverse().join(' ')}`;
dim tusk
#

Nope didn't freaking work

#

NVM

#

I'm just stupid

dim tusk
# dim tusk Guys... I'm kinda confused with this one. ```js world.beforeEvents.worldInitiali...

This stupid error is because of this.

const initialChessPieces = {
    a1: 'rook', b1: 'knight', c1: 'bishop', d1: 'queen', e1: 'king', f1: 'bishop', g1: 'knight', h1: 'rook',
    a2: 'pawn', b2: 'pawn', c2: 'pawn', d2: 'pawn', e2: 'pawn', f2: 'pawn', g2: 'pawn', h2: 'pawn',
    a8: 'rook', b8: 'knight', c8: 'bishop', d8: 'queen', e8: 'king', f8: 'bishop', g8: 'knight', h8: 'rook',
    a7: 'pawn', b7: 'pawn', c7: 'pawn', d7: 'pawn', e7: 'pawn', f7: 'pawn', g7: 'pawn', h7: 'pawn'
};```
#

The games think I am giving a Vector3, which I'm not. So I need to stringify it

cold grove
dim tusk
#
const object = { name: 'Coddy', age: Infinity };
world.setDynamicProperty('test', JSON.stringify(object));|```
dim tusk
cold grove
#

JSON.stringify

valid ice
#

Bro is infinity years old ๐Ÿ’€

dim tusk
#

Ok, I don't get your point.

#

Anyways.. I'm just stupid it's 12:51 in the morning

lone ruin
#

you can't store objects in dynamic properties afaik. so i recommend parsing them first into strings and back

keen laurel
#

That's what json.stringify does

dim tusk
dim tusk
keen laurel
#

Because you already did that

lone ruin
dim tusk
#

i mean I phrased it wrong... so it's my fault I guess lol

lone ruin
#

but im more concerned with how you passed chessBoard:${dimension.id}:${block.location.x},${block.location.y},${block.location.z} as the dynamicProperty name. that should be static, no?

lone ruin
#

i feel like the dimension, and block location should be mapped in a global scope first

#

ie., it should be stored in as a value, not in the name

dim tusk
#

that's not what I want.

#

so I put a dimension with the location since... When I go to the nether and I change in that location in the other dimension it's also affected

chilly fractal
#

If i were you I'd make a class for managing these locations.
รทใ€Š Disappears Into The Darknessใ€‹รท

dim tusk
#

like what?

chilly fractal
dim tusk
#

Also I used dp for debugging because I didn't add states on my block yet

chilly fractal
#

And idk honestly how you are using it

chilly fractal
#

Ehem

#

For getting all dps

keen laurel
#

seeing dp and it not being dynamic programming feels wrong

chilly fractal
chilly fractal
dim tusk
chilly fractal
lone ruin
chilly fractal
#

He's doing it correctly how we are supposed to.

keen laurel
#

realistically you should only have one dynamic property for one chess board, as long as you can fit it within the character constraint

keen laurel
#

but I think that's what he is doing?

#

it looks like he is storing the origin as chessboard:dimension:coordinate

lone ruin
#

by passing chessBoard:${dimension.id}:${block.location.x},${block.location.y},${block.location.z} as an arg, you're making multiple instances of dynamic properties though, are you not?

chilly fractal
#

Yes he is

chilly fractal
#

Y'all just leave bro alone fr. He ain't like those people using commands when native methods exist

#

And i think this personally is better in every aspect.

#

With all due respect plz let this go fr

lone ruin
chilly fractal
#

Not really

#

It depends on the bytes

#

So it doesn't matter from here and there

keen laurel
#

The size for dynamic properties is on the dynamic property itself, not the amount of them

chilly fractal
#

Also stringifying makes them have more useless characters so its worse

lone ruin
#

you can significantly reduce it though. dude its literally java script, just import an npm that compresses strings or something. or better yet compress it yourself

dim tusk
#

bruh

chilly fractal
#

Or you could just do world.getDynamicPropertyIds for having so called "control" that you "never had".

#

Instead of parsing and compressing and stringifiying.

dim tusk
#

For God sake guys, stop because I don't plan on using dp in final

#

I will rely on states of the block

#

WTF

keen laurel
#

@dim tusk do u have a dynamic property for each chessboard block, or just one for the origin? (just curious)

lone ruin
chilly fractal
#

:sigh:

dim tusk
keen laurel
#

yeah that's rlly bad

lone ruin
lone ruin
dim tusk
lone ruin
#

nah just test it and revert it back

keen laurel
#

nope, unlimited amount, each dynamic property is 32kb

dim tusk
#

no difference at all.. why?

grim raft
#

yo

chilly fractal
dim tusk
grim raft
#

it doesnt work for some reason

import { system, world } from "@minecraft/server";

system.runInterval(() => {
    for (const player of world.getAllPlayers()) {
        player.onScreenDisplay.setTitle(`[health_bar_0]`)
    }
})```
dim tusk
chilly fractal
#

What tf do you plan on doin with it?
Also what is the error?

grim raft
chilly fractal
#

Do you have it imported? (If you use a multiple folder system like me)

grim raft
#
import { system, world } from "@minecraft/server";

system.runInterval(() => {
    for (const player of world.getAllPlayers()) {
        player.onScreenDisplay.setTitle(`[health_bar_${Math.round(player.getComponent("health").currentValue / player.getComponent("health").effectiveMax * 24)}]`)
    }
})```
chilly fractal
#

Is your manifest.json valid?

grim raft
#

yea

keen laurel
#

does it have a module with the latest server version though?

chilly fractal
chilly fractal
lone ruin
grim raft
#

is this error related to it?

chilly fractal
chilly fractal
#

Why'd you tell me the manifest.json was valid then?

grim raft
#

cuz I thought it was

keen laurel
grim raft
#
{
    "format_version": 2,
    "metadata": {
        "authors": [
            "TheFennec"
        ],
        "generated_with": {
            "bridge": [
                "2.7.42"
            ],
            "dash": [
                "0.11.7"
            ]
        }
    },
    "header": {
        "name": "pack.name",
        "description": "pack.description",
        "min_engine_version": [
            1,
            21,
            0
        ],
        "uuid": "e475ba8c-2c66-48b0-907e-d05530a85f34",
        "version": [
            1,
            0,
            0
        ]
    },
    "modules": [
        {
            "type": "data",
            "uuid": "e7935e60-ddfa-409f-bb5c-6422130f874e",
            "version": [
                1,
                0,
                0
            ]
        },
        {
            "type": "script",
            "language": "javascript",
            "uuid": "0f351690-4277-4fdd-a968-8478eccb7ae8",
            "entry": "scripts/main.js",
            "version": [
                1,
                0,
                0
            ]
        }
    ],
    "dependencies": [
        {
            "uuid": "4b6432bd-d96c-458a-8615-abb6c49fd606",
            "version": [
                1,
                0,
                0
            ]
        },
        {
            "module_name": "@minecraft/server",
            "version": "1.16.0"
        }
    ]
}```
chilly fractal
#

Hmmm

#

Looks valid

#

Then its something else in you scripts

chilly fractal
keen laurel
#

Is it possible that it's happening before the player fully loads in the world and the game doesn't know how to run it lol

chilly fractal
#

It would keep throwing errors instead of stopping the whole script.

grim raft
#

there are no errors

chilly fractal
grim raft
#

bruh

chilly fractal
#

Its something in your other script files.

#

Provide the whole content log

lone ruin
dim tusk
grim raft
#

any

#

just 1 file

keen laurel
chilly fractal
#

There is no possible way for me to know, without full context and all of the log.

distant tulip
keen laurel
#

later after talking u said u just wanted 1 so it's fine

dim tusk
#

if you plan that

lone ruin
keen laurel
#

sorry ur right 33 my bad

lone ruin
#

i guess the chess pieces would need to be rendered

#

which is another problem

dim tusk
keen laurel
#

Is it possible to make a chessboard in one block? lmao

#

like using molang

distant tulip
#

you are forgetting that the key can also be any char long
"x" to "x"*32k + every other combination

grim raft
dim tusk
grim raft
#

if it still doesnt work then the problem is in my json ui

grim raft
lone ruin
dim tusk
#

1,219,760,487,635,835,700,138,573,862,562,971,820,755,615,294,131,238,401

This is the total permutation of a block if every position has 5 state values, empty, pawn, etc.

lone ruin
#

nah thats no good lol

dim tusk
grim raft
distant tulip
dim tusk
#

Nuh uh

distant tulip
cold grove
dim tusk
#

I phrased it wrong that's why. LMFAO

distant tulip
#

@grim raft work fine... i guess?

#

no error

grim raft
#

it shouldnt look like that

#

OH NVM I FIXED IT

#

forgot smth in my hud_screen

#

mb guys

#

the script works

dim tusk
#

BRUH

#

LoL

dim tusk
#

Just a little map in the position pieces can move to...

dim fractal
#

Does anyone know how to make a capture the flag system?

chilly fractal
dim tusk
#

My tini tiny finger hurts now

chilly fractal
chilly fractal
dim tusk
#

i actually implemented the pawn now wohoo after 1 hou

chilly fractal
#

Crazy lol but i bet there is like a thousand checks and not to mention the amount of permutations right?

#

I am thinking about my website and trying to think about script api but i can't so yeah im sorry for taking long to type lmao

valid ice
#

Chess is so hard

chilly fractal
#

But you are displaying stuff using multiple print statements and using multiple nested if statements i believe.

#

Me personally i could make chess without manually doing anything at all on html & js and a tiny bit of css.

#

And idk I'll find some chess playing algorithm and implement it to play against me lol

#

But doing this on mc and not using forms nah. Using block permutations.

#

Kinda mad fr

#

Imagine

#

The only possible way i see coddy finishing this project is to auto generate the permutations.

untold magnet
#

hmm

#

i have this thing eBlock?.withState('exe:rotation', rotation) on playerPlaceBlock ( beforrEvents )
and it has a log, it says the air block doesn't have the 'exe:rotation' state,

#

i think that happened cuz the system ran that before i even placed the block

chilly fractal
#

Then simply cache the block and do system.run(() => { /* your code */});

#

By cache i mean storing a variable with whatever name pleases you the most and assigning it's value to the raw block object.