#Script API General
1 messages · Page 16 of 1
double it and give it to the next person
banneditemslist[0]
alr
is that chest ui
Can still do that without doubling
Each comma represents an element in an array
that return array in your case
Yea
#1198678479928033452
const banneditemlist = [ "minecraft:skull", "minecraft:Herobrine" ];
console.log(banneditemlist[0]); // minecraft:skull
console.log(banneditemlist[1]); // minecraft:Herobrine
But
But what?
1 sec
let banneditemslist = [[`minecraft:skull`],[`minecraft:Herobrine`]]
İf (item != banneditemslist[0]) {
}
const skulls = {
0: "skeleton",
//...
}
let skullData = 0
for(let data = 0; data < 6; data++) {
const commandResult = player.runCommand(`testfor @s[hasitem={location=slot.inventory,slot=${slot},item=${id},data=${data}}]`);
if (commandResult.successCount > 0) {
skullData = data
break
}
}
const type = skulls[skullData]
banneditemlist[0] returns an array.
console.log(banneditemlist[0]) // ["minecraft:skull"]
You have two arrays inside a single array.
Yup, wasted resources in that instance lol.
I just realized this
All good 👍
const tier1 = new ItemStack("minecraft:chest", 1)
inventory.addItem(tier1)
tier1.nameTag == "tier 1"
Is this the right way to add a name to a item you want to give yourself?
set name before adding to inventory
Is there an alternative to world initialize event that is not beta?
i already tried that so am wondering if am setting the name wrong?
world initalize is not beta
Good to know
It's stable in 1.13.0, as are custom components 👍
oh, single equals is assignment, not double
double is comparing it to the existing name
ohhh i didnt know because i thought double equals could do both assignment and compair
thanks for that
Loose comparison
Triple is strict comparison
Meaning it won't work with 1.9.0?
It will not, no.
Custom components just went stable (along with world initalize) in 1.13.0
Anyone master getting a Vector3 from a DynamicProperty while using ts-check and using it , i.e. passing to function with Jdoc saying expected type is Vector3, without having to use ts-ignore..??? in JavaScript. I cannot find a way to trick it.
oh alright
is there a way to clear a item from your main hand?
Player.getComponent('equippable').setEquipment('Mainhand')
I just do it as:
item.getDynamicProperty() as Vector3
Cannot do type assertion in JS
/** @type {Vector3} */ doesn't work?
It will suggest it in Intellisense, but it will not highlight invalid usage as an error IIRC
Nope
hmm
Well it is a valid error. It could return undefined.
I get around almost everything else.. but this one. The code works fine, but I want to use JS with ts-check and jdoc to force me to do the things that make sure I don't mix types.
TypeScript has the "ignore any issues" operator, !, but JS does not have an equivalent I believe
Shows as error only with ts-check.. not a real error
I'm using that to get all entities, so is it possible to do that inside of runInterval?
i think so
I can use ts-ignore above the line.. tryna avoid that if I can
Just have to loop through the result of that line
You won't like my other suggestion then. I suggest asserting that the type is defined through a type comparison:
if(xyz == undefined) return;
Then thereafter xyz cannot potentially be undefined ... though I suppose this is not fixing the assignment step
thanks for help budd
is there a way to do it one at a time?
world.structureManager.place("kit:1", player.dimension, { ...player.location, y: player.location.y + 2})
const inventory = player.getComponent(`inventory`).container
const block = player.dimension.getBlock({ ...player.location, y: player.location.y + 2 })
const chest = block.getComponent(`inventory`).container
for (let i = 1; i < chest.size; i++) {
const item = chest.getItem(i)
if (item) inventory.addItem(item)
}
player.getComponent('equippable').setEquipment('Mainhand')
system.run(() => { block.setType(`minecraft:air`) });
Or when assigning XYZ, use null coalescing:
const xyz = world.getDynamicProperty('my_property') ?? {x: 0, y: 0, z: 0};
wdym one at a time?
like /clear @s stick 0 1
oh. There's no native methods for that, no
oh alright then
Take a look how getComponent's typings work
It seems that using xyz period is a problem as everything is typed....js const xyz = world.getDynamicProperty("deadEntityLocation") ?? {x: 0, y: 0, z: 0}; const entityLocation = !['string','boolean','number','undefined'].includes(typeof xyz) ? xyz : {x: 0, y: 0, z: 0} if (entityDimensionId && entityLocation ) msg += ` @ ${entityDimensionId} ${fn.vector3Msg(entityLocation)}`;
the last part is not happy because that function requires vector3.. pic is the annotation I see.
cannot seem to assure it that I am sending a Vector3
without using ts-ignore above the line
Shrimply use typescript
This seems to work for me:
const xyz = world.getDynamicProperty("deadEntityLocation");
if (typeof xyz != 'object') return;
if (entityDimensionId) msg += ` @ ${entityDimensionId} ${fn.vector3Msg(xyz)}`;
module or game version?
Is that ts translated to js ?
That worked, but reworked..js const xyz = world.getDynamicProperty("deadEntityLocation"); if (typeof xyz == 'object') { if (entityDimensionId) msg += ` @ ${entityDimensionId} ${fn.vector3Msg(xyz)}`; }
What are u trying to do ?
Thanks Sprunkles.. nice to see ya lurking around handing out the knowledge again
ok nice to see that instead of the code sent previously
You referring to the includes(typeof xyz) bit? Or me doing early-out return
Me and ts-check with Jdoc playing hide and seek... should see what I had to do for a callback ptr... and still not sure this is the best way #1276605171635327007 message
Script module version 1.13.0
How do I get all blocks in an certain area?
would anyone happen to know where in the writable_book item the written data is stored at? both the getlore() and getcomponents() methods are returning array sizes of zero.
why did that not work.. did I do it backwards?
There is a space between your ] (
system.runInterval(() => {
const dimensions = ['overworld', 'nether', 'the_end'].map(dim => {
for (const entity of world.getDimension(dim).getEntities()) {
const block = entity.dimension.getBlock(entity.location)
if (block.below(0.1).typeId === 'minecraft:dirt') world.sendMessage('DIRT!!')
}
})
})
```this should work right?
yes it dose
lemme cook now
entity.runCommandAsync(`execute at ${entity},,,)
```isnt working
especially at ${entity}
Because that’s incorrect syntax, it would have to be inside a @e[type=
Have you tried @s as well
entity.runCommandAsync(`execute at @e[type=¢{entity}] ,,,`)
```?
That’s gonna run it to every entity matched
i know how @e work,
Then you have the answer to your question
so this how it should be written right?
assuming your entity is returning a typeId, yeah
alright cool, thanks batman
stills the same log, anyways I'll try @e only and do some tests
Send the error
Has anyone got the inventory part to work with herobrines chest ui?
Hoping someone have already made a custom fix
the game runs fine, but...
u can see how laggy is it when i used only 2 commands, jeez
are these commands memory leak?
is laggy because for every entity, you are running the command for every same type of entity. So if you had 3 chickens, instead of 3 commands, you are running 3+3+3
gets exponential real fast
thats what i was thinking many instances
better to use native
just depends on the command being used
each entity should run @s for itself
execute at @s cannot work on entities, ig
it works in commands.... are they not a self.... then do @e with c=1
they are the closest to themselves
so like this?
entity.runCommand(`execute at @s if block ~0.3 ~-0.1 ~ exe:conveyor["minecraft:cardinal_direction" = "north"] run scriptevent conv:North`)
c = closest #
that actually makes sense bec entity is already a world.dim.getAllEntities
i mean for (const entity of world.getDimension(dim).getEntities()) {
lemme try @s first
it's working fine now
awesome
do you have a a down and up for all sides? that would be so nice, it goes diagnoally down up etc... instead of just dropping off ledges, and could travel upwards
i will be doing that but on another block
this would be awesome as just a standalone pack, what kinda addon?
conveyors are the basic machines
awh ok
would work well with the new crafting block
and hoppers
feel like true factory lol
to move entities up or down or any direction, use a block called fan ig that are enhanced machinery
over 37+ new ores tho
ooo thats cool
i will add uranium too :>
to create a nuclear reactor for generating infinite power from it
and yes
oh very fun
theres some nuclear weapons, but only on creative
imagine u walk up to ur house and ur friend set a nuclear bomb on it,
its just a prank tho
lol
u should use applyImplus for entities, and applyKnockback for the players
bec TP isn't really nice
I think I didn't because it makes me look like I am walking, even if I m standing still
tp is fine once you find the right speed, it can be smooth
umm
space it out... I think Iread somewhere you get 128 per tick
um, how?
remember, 20 ticks in one second.. don't need everything to be every tick... can be every... 5 ot 10
would need to see whole block of code to follow your logic
u mean making the interval works every 5 ticks or something?
actually
putting the commands inside of a function ( a minecraft function ) will make it better right?
in block you set that.. here is mine json "minecraft:tick":{"interval_range": [6,6],"looping": true},
and then your onTick... does the rest
are you not using that
im not even using onTick thing
look up run job, still command, but from script and runJob gives it the time to finish
like putting all of my commands inside of one runJob? or making a runJob for each command?
ok, guess we have diff aproaches... my blocks checks for someone on it and moves them along to it's edge and the next conveyor, if any picks them up and continues
yeah best not to use comands if too many items... i know runCommandAsync has limit
the run job was for the /fill guy
yeah runJob is the best method for filling blocks
oh,
but yeahj, run job can space out your multiple commands over the ticks so you don't crash
i should put the commands inside of a function right? im still running them all but in the scripts section im running only one command
Did you not do command blocks before.... they all add up.. don't matter if you run one thing... if that thing runs 400, then it is 401 things
but I do not know how they do the queue thing.. you need to spam test it
just add a side chat command that can do it
i actually have 32 commands to do for the conveyor for each 4 directions
so
im getting that issue with only 8 commands
but for how many entities and how often
also, runCommand or runCommandAsync?
for each entity that is above or in the edges of the block
the script works on every single entity in the overworld, nether and the end
don't know.. I just use runCommand.... I don't need anything at same exact time.... humans don't register things that fast
how many entities on the conveyor when you test
I made a square track (from the video in my post) so I can control where they go and how many.
0
that happens when i spawned only 3 pigs
So you are not using custom components?
as my calculations, 32 commands will run for every single entity in the overworld and the nether and the end, which means; 2 entities = 64 command per tick
200 entities = 6,400 command per tick
7K entities = 224,000 command per tick
so taht each part of the conveyor just processes it's own entities?
that is the object oriented way
or are you testing each entity to see if they are above a conveyor?
so i think, onTick could be the right choice
const entity of world.getDimension(dim).getEntities()
entity.runCommandAsync
this should explain
each entity will run a command
How do I use player.teleport, like the dimension
Entity.teleport(location: Vector3, teleportOptions?: TeleportOptions): void
@remarks
Teleports the selected entity to a new location
This function can't be called in read-only mode.
@param location — New location for the entity.
@param teleportOptions — Options regarding the teleport operation.
so in the options is to change dimensions .. but a conveyor is local, so no need to specify
i think onTick is more often in this situation
click on the options to get those details
world.afterEvents.playerDimensionChange.subscribe(evd => {
const player = evd.player
const from = evd.fromLocation
const fromDimension = evd.fromDimension
if (fromDimension.id === "minecraft:overworld") {
if (evd.toDimension.id === "minecraft:nether") {
//player.runCommandAsync(`tickingarea add circle ${from.x} ${from.y} ${from.z} 1`)
player.teleport(from, fromDimension)
//setTimeout(() => player.runCommandAsync(`tickingarea remove ${from.x} ${from.y} ${from.z}`), 10)
return new Message(`§c§lThe Nether Is Banned.`, player)
}
}
})
This works other than it doesn’t switch me to the over world
you do not need to specify a dimension if not changing it
and.. that is the wrong format... see that link and look at teleport options, it is an object, not a striung
FromDimension is not a string?
the second parm would be{dimension: "minecraft:overworld"}
there are other options you need to read them all
and add them into the object
I was on the docs and there is no teleport method posted
keep velocity is nice
world.afterEvents.playerDimensionChange.subscribe(evd => {
const player = evd.player
const from = evd.fromLocation
const fromDimension = evd.fromDimension
if (fromDimension.id === "minecraft:overworld") {
if (evd.toDimension.id === "minecraft:nether") {
//player.runCommandAsync(`tickingarea add circle ${from.x} ${from.y} ${from.z} 1`)
player.teleport(from, { dimension: `${fromDimension.id}`, keepVelocity: false })
//setTimeout(() => player.runCommandAsync(`tickingarea remove ${from.x} ${from.y} ${from.z}`), 10)
return new Message(`§c§lThe Nether Is Banned.`, player)
}
}
})
Oh wait
Isn't from where they are now and you said you are trying to take them out of there
so your from should be wher you want them to go
should not be called from
call TO
but you will put them in a strange place
you may want to do the 8 block math
Idk if this is even it
Hold up
You can pass a location argument
dimension.getEntites({
location: Vector3
}) I think
always click on the options... it is an interface with multiple useful properties to make your options object
onTick: i => {
i.dimension.runCommand('execute at @e[r=1] run scriptevent c:c)
}
``` @neat hound ?
r=1 is big a block in each direction... what is in this script event.
use c=1 guarantee to pick up only the self
what are they trying to do
he has a non-object-oriented conveyor belt... which means doing something with all entities all dimensions.... and has runcommand issues
the other guy is tryna TP people out of the nether after they go in
I'm going to go watch TV... your turn....
Will onStepOn event be a better option
Jayly.. love your docs.. I don't thinik I ever close the web page....
of course.. be he may need to realize... woulda gave my code, but he needs to work it out... trial and error... so he can learn via experience.
Item grouper addon?
world.afterEvents.playerInteractWithBlock.subscribe```
what´s wrong with the sintaxis of this?
the game doesnt recognizes the event
Are you using beta apis?
Whats your script api version
nope, is this still on beta?
Yes
lol use beta api
interactWithBlock still isn't stable
Stable
mmm d you guys know howto search in the documentation the use of block components? xd
you can learn so much about block custom components, by this
then for block components.. goto world before events
then world initialize
then subscribe
has the stuff there
If you click
you can get to page to change latest/preview
then
click on everything, lots of examples... but I know they added to the MS learn about the block components with an example and I hear the wiki is updated with some examples too
good luck... if you still have trouble people around... the green people really know there stuff.. and that pink person too

color blind.. look at the name tags.... when have I ever insulted anyone?
I am just glad I am orange... master of all colors... resistance is futile
we all pink smh, no one's insulting anyone smh
I am not pink... by that standard, LOL
anyway 
unless you turn me insside out
can someone smart correctly describe what the ternary operator is, cuz reading online what i have gathered its just an if statement with extra steps, but yet putting it inside an if statement changes the outcome even tho itself is an if statement???
condition ? (value if true) : (value if false)
but then cant you just use ifs and if nots/else?
if else is readable
i mean i guess it makes sense?
const text = (isOnGround ? '§pGround' : '') + (block?.isSolid ? '§mSolid§r' : '§aair§r');
selection ? about(p, cs) : exit(p);
yes but ter. is short for eg, if you want to return a value based on condition
with if else it would be like
if (player.isSneaking)
return 10
else
return 20
whereas tern. looks like this
return player.isSneaking ? 10 : 20
clearly 2nd is better for smaller stuff otherwise if is more readable
the best use case is assigning a value on condition
with if else it will look like
let value = 20
if (player.isSneaking){
value = 10
}
it can get longer with more conditions
but with ?
const value = player.isSneaking ? 10 : 20
how can i filter online player?
getplayers only return online players
oh ty
do I need to always make a function to get a return variable, or is there a simpler alternative?
I'm trying to get the boolean of whether or not a tryTeleport succeeds or fails.
no
just assign the tryTeleport result directly to a variable
Joke
so something like this? js let test = return tryTeleport()
oh right, that makes sense
What is the maximum score on the scoreboard?
32-bit integer limit
2,147,483,647
what is ds?
Well object it self is 0(1)
its same as hash table
do you mean like dynamic db ds
keyless ds
Hey green masters... question. So..js const cb = world...subscribe((event) {stuff})I know I can use cb to cancel the subscription as in js world..unsubscribe(cb)but later, can I js world...subscribe(cb)if that is not the way, do I just put the subscribe in a function to call it again after an unsub?
no
make the event into a function that you can run when needed
how did u get your pfp tbh? I want a pfp like u
How do I detect if a player is afk?
check if players velocity is 0 for a long time
I drew it
draw one for me 😙
no 🗿
💀
Yes
const cd = ev1.subscribe(function R() {
console.warn({R: R === cd})
ev1.unsubscribe(cd)
const cd2 = ev1.subscribe(cd)
const cd3 = ev1.subscribe(R)
console.warn({
['cd === cd2']: cd === cd2,
['R === cd2']: R === cd2,
['cd3 === cd2']: cd3 === cd2
})
}) ```
its literal work
is it that simple?
perhaps
but any velocity could make it misfire
ig making it less tight could work
velocity and rotation
i think i need help a little bit
if (state === 'north') i.block.dimension.runCommandAsync(execute at @e[r=1] run say Hi) is not working
How do I make a game loop using system.runJob()?
It seems to be more efficient than system.runInterval(), reason why I want to use it
runCommandAsync("command") it needs to be a string
its not about being efficient only thing it does it manage yoir tasks to better fit in timeing between ticks
ticksif you have more little task then multiple of them are executed in single tick
I just want everything to run as expected each tick
function run() {
system.runJob(() => {
run()
})
}
run()
um, can u explain?
i had to make that command detects entities that is above the block and make it run a say Hi command
Also, I don't know how to use generator functions properly
just add ""
fr?
yeah its just a string
if (state === 'north') i.block.dimension.runCommandAsync("execute at @e[r=1] run say Hi")
yeah, otherwise it will try to find the stuff what you wrote if theres no string format
const yeet = "say yeet";
player.runCommand(yeet);
but this will not work
player.runCommand(say yeet);
the command is working but with an issue, r=1 isn't working for some reason
because its starting from the dimension
youd want to specify position too
no
its a little bit confusing
i mean
yeah but not exactly the same maybe
i would say use i.block.dimension for safety
that what im using and not working
also i meant this as in positioned inside execute command
should i put that command inside of system.run?
no unless youre using beforeEvents
bec worldInitialize are beforeEvents thing
the command is running when i use @e or c=1
but r=1 or dy=1 isn't working
worldInitialize registers the code into the stuff, which later makes the stuff to run the code you did
system.run is for events that fires before the event
um, im using onTick
still
im literally confused
onTick: i => {,,,
if (state === 'north') i.block.dimension.runCommandAsync("execute at @e[dy=1] run scriptevent conv:North")
whats that ,,,
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
if (state === 'north') i.block.dimension.runCommandAsync("execute at @e[dy=1] run scriptevent conv:North")
}
oh
thats all
so what im trying to say here
is that i.block.dimension points to the dimension the block is in, not the block itself
so you need to make the execute to have positioned
also why dont you just run the code directly into there
instead of using command
Same question
the problem is idk how
you dont know how to use execute command? or specify the location of the block
im trying to make the block detect entities above it and make them move by applyImplus, nothing else :/

you cant use positioned and r=1 at the same time, r=1 needs to be referred to an entity not a location
whar

i.dimension.getEntitiesAtBlockLocation?
import {system} from '@minecraft/server';
system.runJob(test());
function* test() {
for(let i = 0;i <= 1000){
yield i
}
}
each time you yield that count as a run
basically everything before yield will run at once
i.block.dimension.getEntities({
//EntityQueryOptions, check the docs
});```
how can you do the execute? execute at @e[r=1] positioned x y z run???
dont you put positioned before at
also as instead of at
for (const entity of i.dimension.getEntities()) {,,,}?
real its crazy how similar to async it actually is
i didnt know you can use positioned before specifying the entityt
then entity.runCommandAsync(",,,")?
yeah sure but
im still wondering why you dont run code directly
and use scriptevent
nah nah nah, that will make each entity run a command every tick
bro just use "execute positioned x y z as @a[r=1] run say hi"

you can limit the number of entity i think?
in EntityQueryOptions
const { x, y, z } = i.block.location;
i.block.dimension.runCommandAsync(`execute positioned ${x} ${y} ${z} as @e[r=1] run say Hi`)
```?
yeah
yesss
woah

thats smart

i didnt know u could do that
well, that works even if the entity is around the block by 0.15px
is it possible with player.getComponent("inventory")
also get the data from items?
for example splash_potion 1 5
@e[r=0.825] is the perfect one
or maybe r=0.81725
the important thing is the entities will be detected when they're above it
then just add 0.2 to y level
its quite glitched on the far edges, but no problems bec u gonna put multiple of them in the same place
dy=0.2?
y=0.2?
y + 0.2
dy isn't really good to deal with
const { x, y, z } = i.block.location;
i.block.dimension.runCommandAsync(`execute positioned ${x} ${( y + 0.2 )} ${z} as @e[r=1] run say Hi`)
oh, the problem is actually on the r=1
what are you trying to do?
u gona need the center coord for dat
the @e[r=1] detects far away from the block
yeah
i used to use in in my ender chest inspector but switched to async function later
block.dimension.getEntities({location: block.center(), maxDistance: 0.5})
then dont use r=1 and use scripts without commands
this will give you a list of the entities standing on the block
const {x,y,z} = block.center()
bottomCenter maybe better in his case
then y + 0.8
this should detect entities only at the distance, the commands will never run until the entity is in the distance right?
doesnt work becouse r=1 is a sphere with 1 as radius so it wont work either
const entities = block.dimension.getEntities({location: block.center(), maxDistance: 0.5})
for (const entity of entities) {
entity.runCommand("say yes" )
}
Ohh, ok. Thanks!!
maxDistance: 0.5 will not detect the edges of my block, i had to put it 1, but 1 will detect far above the block
is there any way to make that detect more for X and Z but less for Y?
that is what i was talking about, you cant use maxdistance becouse the distance is a sphere not a block
it simply detects the entities in a sphere with the radius of half a block in the center of the block
a radius of 1 is a sphere that's 2 blocks wide
i tested it, and it detects me within 1 block not 2
do the detecxdion in maxdistance 1 then do that to see if its in the block position
const eLoc = entity.location
const bLoc = block.center().location
if (eLoc.x.toFixed(0) == bLoc.x.toFixed(0) &&
eLoc.y.toFixed(1) <= bLoc.y.toFixed(1) &&
eLoc.y.toFixed(0) == bLoc.y.toFixed(0) &&
eLoc.z.toFixed(0) == bLoc.z.toFixed(0)) {
player.sendMessage(`hi`)
}
maybe it detects the center of the entity? not the edge of its hitbox
@untold magnet
you can add a y level condition if the height is the only problem
the problem is that the covered area is a sphere and not a square
if (block.y != Math.floor(entity.location.y)) continue
my brain hurts
u know what, i give up
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
}
im not great at all on Math thing
send the code
it detects the player standing above it because the player center is the center of its feet, so it's inside the sphere that is 2 blocks wide
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
}
})
})
how would i call a function that has the value of a variable? for example
const functionName = myFunctionName;
//run function named after the value of functionName```
i don't understand
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block
for (const entity of block.dimension.getEntities({ location: block.center(), maxDistance: 1 })) {
const eLoc = entity.location
const bLoc = block.center()
if (eLoc.x.toFixed(0) == bLoc.x.toFixed(0) &&
eLoc.y.toFixed(0) == bLoc.y.toFixed(0) &&
eLoc.y.toFixed(1) <= bLoc.y.toFixed(1) &&
eLoc.z.toFixed(0) == bLoc.z.toFixed(0)) {
world.sendMessage(`hi`)
}
}
}
})
})
try that should work @untold magnet
actually i think i got an idea
try again i changed it
i forgot to specify location
umm
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block
for (const entity of block.dimension.getEntities({ maxDistance: 1 })) {
const eLoc = entity.location
const bLoc = block.center()
if (eLoc.x.toFixed(0) == bLoc.x.toFixed(0) &&
eLoc.y.toFixed(0) == bLoc.y.toFixed(0) &&
eLoc.z.toFixed(0) == bLoc.z.toFixed(0)) {
world.sendMessage(`hi`)
}
}
}
})
})
try that
i deleted the half block detection
How to test a player's game mode
player.getGameMode()
nothing works
Thanks
just do this to look for what could be wrong
world.sendMessage(`${}`)
no logs
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block
for (const entity of block.dimension.getEntities({ maxDistance: 1 })) {
const eLoc = entity.location
const bLoc = block.center()
if (Math.floor.(eLoc.x) == Math.floor.(bLoc.x) &&
Math.floor.(eLoc.y) == Math.floor.(bLoc.y) &&
Math.floor.(eLoc.z) == Math.floor.(bLoc.z)) {
world.sendMessage(`hi`)
}
}
}
})
})
tell me the values that shows in chat when you are standing on the block
absolute nothing, u know what i can use that maxDistance: 1 bec the entity will keep falling into the block but it will move a little bit farther from the block
no values are showing up on screen?
nothing at all
change the distance to 10
still nothing, bro stop
okk, but idk whats wrong
its fine if the script detects the entity a little bit higher
What's going on here?
nah bro dont say that
meh, i just hate life 
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block
for (const entity of block.dimension.getEntities({ location: block.center(), maxDistance: 1 })) {
const eLoc = entity.location
const bLoc = block.center()
if (Math.floor(eLoc.x) == Math.floor(bLoc.x) &&
Math.floor(eLoc.y) == Math.floor(bLoc.y) &&
Math.floor(eLoc.z) == Math.floor(bLoc.z)) {
world.sendMessage(`entity detected`)
} else {
world.sendMessage(`no entities detected`)
}
}
}
})
})
i think i found the issue
wait i correct something
is it possible to stop a script? like terminate it forcefully?
Entity detected only when i go inside the block
wasnt that what you wanted?
no, detecting the entity happens only when the entity is above the block, no matter if the far edges cannot be detected,
yeah werent you above the block rn?
far edges are those;
- X / + Z
- X / + Z
- X / - Z
- X / - Z
How queer
it will detect it when i go inside the block, not on the edges
Yes
edges are ± X and ± Z important
far edges are ± X + ± Z not really important
how so?
If statements
And
/Scriptevent
Command
Just fold it with if statement
With outer variable
Global one i mean
yeah becouse player location is a point not a volume so it will detect only if player center is on the block
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block
for (const entity of block.dimension.getEntities({ location: block.center(), maxDistance: 1 })) {
const eLoc = entity.location
const bLoc = block.center()
if (Math.round(eLoc.x) == Math.floor(bLoc.x) &&
Math.round(eLoc.y) == Math.floor(bLoc.y) &&
Math.round(eLoc.z) == Math.floor(bLoc.z)) {
world.sendMessage(`entity detected`)
} else {
world.sendMessage(`no entities detected`)
}
}
}
})
})
@untold magnet try that:
Like this
let brutalForceOff = false;
if ( !brutalForceOff ) {
//Put ur code in here
}
oh
alright thanks, but would that also mean i have to do it for every after and before events?
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block;
const detectionOffset = 0.5
const bLoc = block.center()
for (const entity of block.dimension.getEntities({ location: bLoc, maxDistance: 2 })) {
const eLoc = entity.location;
if (eLoc.x >= bLoc.x - detectionOffset && eLoc.x <= bLoc.x + detectionOffset &&
eLoc.y >= bLoc.y - detectionOffset && eLoc.y <= bLoc.y + detectionOffset &&
eLoc.z >= bLoc.z - detectionOffset && eLoc.z <= bLoc.z + detectionOffset) {
world.sendMessage(`entity detected`);
} else {
world.sendMessage(`no entities detected`);
}
}
}
})
})
try that, im not that good at math either
this detects the entity center ig
you tried with 2 as distance?
try adding 1 to detection distance
same
oh lemme try that distance offset
with 1 distance offset it works the same as that old one
it detects me from 1 block high
@misty pivot
U can use
scriptEvents event
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry: block }) => {
block.registerCustomComponent('exe:conveyor', {
onTick: i => {
const state = i.block.permutation.getState('minecraft:cardinal_direction');
const block = i.block;
const detectionOffset = 1.5
const bLoc = block.center()
for (const entity of block.dimension.getEntities({ location: bLoc, maxDistance: 2 })) {
const eLoc = entity.location;
if (eLoc.x >= bLoc.x - detectionOffset && eLoc.x <= bLoc.x + detectionOffset &&
eLoc.y >= bLoc.y && eLoc.y <= bLoc.y &&
eLoc.z >= bLoc.z - detectionOffset && eLoc.z <= bLoc.z + detectionOffset) {
world.sendMessage(`entity detected`);
} else {
world.sendMessage(`no entities detected`);
}
}
}
})
})
Or use chatSend event
try that
can custom block detect redstone stuff ?@untold magnet
idk + hopefully it does
In 1.21.30 yes
what we have
redstone conductivity component
now?
use volume 
it cant detect the entity, i think u should stop for now
take a rest from thinking
ok btw if you want just send me the mod and ill try to find the issue
i dont think u have to bec its not a huge issue that will make farms not working
its just detecting the entity like 0.7p higher than the normal 0.3p block
the block collision box is 4, normal block is 16 so the script will detect 8px above the block
which is wrong but its not a huge issue
i just like to solve problems like theese
those issues require math
and i hate math
i got 3 in algebra math at school
whered doc for that
Question to the vector aficionados v3 -> v2 is ?```js
/**
- @param { import("@minecraft/server").Vector3} vector3
- @returns { import("@minecraft/server").Vector2}
*/
static toVector2 (vector3) {
return {
x: vector3.x,
y: vector3.z // <-----
};
}```
z ----> y
What are you asking?
it the Z is the Y of vector 2
What is vector2?
https://stirante.com/script/server/1.13.0/interfaces/Vector2.html
Documentation for @minecraft/server
Youre thinking of VecrorXZ
https://stirante.com/script/server/1.13.0/interfaces/VectorXZ.html
Documentation for @minecraft/server
All Vector Interfaces
am i using this wrong or is it broken?
player.camera.fade({red:1, green:0, blue:0, fadeInTime:0, holdTime:10, fadeOutTime:7})```
it just goes black everytime & does its own fade time.
console.warn(`Yaw ${yawDegrees}`);
console.warn(`Pitch ${pitchDegrees}`);
player.setRotation({ y: yawDegrees, x: pitchDegrees })
whats wrong? my player wont rotate
It's telling me 1 isnt in the range of [ 0 - 5 ]
Unhandled promise rejection: EnchantmentLevelOutOfBoundsError: When trying to add enchantment instance - Tyring to set enchantment level to 1, range for type smite is [0 - 5].
I think enough context here
could someone tell me why this dont work
case "minecraft:ender_chest":
if(!player.hasTag(`rookie`) || player.hasTag(`soldier`) || player.hasTag(`elite`) || player.hasTag(`general`) || player.hasTag(`overlord`) || player.hasTag(`king`) || player.hasTag(`emeperor`) || player.hasTag(`dragon`) || player.hasTag(`eld-dragon`) || player.hasTag(`demi-god`) || player.hasTag(`god`) || player.addTag(`eld-god`)){
r.cancel = true
player.sendMessage(`HCV KitPvP >> You need to be rookie rank or higher to use this`)
}
break;
even when i have 1 of the tags listed
is rookie rank included in this function?
cuz !player.hasTag('rookie') and You need to be rookie rank or higher seems to conflict
or my english is broken and i should fix it
This happens when youre trying to add an incompatible enchantment if i recall
I'm trying to add smite to a golden sword with only sharpness III, that should be compatible
am checking if a player does not have any of the tags listed. It runs the sendMessage
Smite and sharpness are incompatible
Thats your issue
Try this ```js
case "minecraft:ender_chest":
if (
!(
player.hasTag("rookie") ||
player.hasTag("soldier") ||
player.hasTag("elite") ||
player.hasTag("general") ||
player.hasTag("overlord") ||
player.hasTag("king") ||
player.hasTag("emperor") ||
player.hasTag("dragon") ||
player.hasTag("eld-dragon") ||
player.hasTag("demi-god") ||
player.hasTag("god") ||
player.addTag("eld-god")
)
) {
r.cancel = true;
player.sendMessage(HCV KitPvP >> You need to be rookie rank or higher to use this);
}
break;
you put the not statment out side the main bracket?
how comes
then you should add a parentheses like this
if (!(
player.hasTag(`rookie`) ||
player.hasTag(`soldier`) ||
player.hasTag(`elite`) ||
player.hasTag(`general`) ||
player.hasTag(`overlord`) ||
player.hasTag(`king`) ||
player.hasTag(`emeperor`) ||
player.hasTag(`dragon`) ||
player.hasTag(`eld-dragon`) ||
player.hasTag(`demi-god`) ||
player.hasTag(`god`) ||
player.addTag(`eld-god`)
) {...
yeah it is
const list = {
"member": 1,
"rookie": 2,
"knight": 3
};
const rank = "member";
const weight = list[rank];
if (list["knight"] - weight > 0) {
// can rank up
} else {
// can't rank up
}
I would do a system like this
Or some
ohh alright am guessing I put the "not" operator in the wrong place
thank you
np :)
ohhh
thats cool
tho I would prefer this system
for updating & debugging sake
i have a simply system where i just use the Objs and check if the players are >= to tem
them*
We’ll really it’s just a shrunken one
thats cold ngl
Yea, I try not to complicate things other than creating all those blocks.
yeah your right
easy to debug later on
Plus, if you can make a system that adapts to your changes, then debugging is so much easier and it’s such a better system
Like a shop that gets its items from an object
yeah your right
and you'll ended up with a flexible and easy-to-change system :)
i should have just put all the tags into a array and did .some()
I mean you can
Whatever rank you put in the if statement would be the required rank, so that’s why this is just easy
I think it’s flipped tho
someone please try this script: https://discord.com/channels/523663022053392405/1276955348431012052, I haven't tested it on the latest version 1.21.20+, it's still on version 1.21.0+
Just test it really quick.
You should do that if it needs updating anyways.
How do I give a player a wither skeleton head?
Some know if playerInteractWithEntity is stable?
Only beta
Save it in an inventory (chest, entity, something), then transfer it to another container
Hmm
But for this I need to change the whole code
I used Dynamicproperty

lol
i think so
What's up with you not wanting to suggest commands? 👀
Commands are stinky
don't let them hear you
anyone have an example of how to use camerFadeOptions?
player.camera.fade({red:1, green:0, blue:0, fadeInTime:0, holdTime:10, fadeOutTime:7})```
this just goes black everytime & does its own fade time. idk if im using it wrong.
player.camera.fade({fadeColor: {red:1, green:0, blue:0}, fadeTime: {fadeInTime:0, holdTime:10, fadeOutTime:7}})
@granite badger
please add a sidebar for the versions so we don't have to scroll all the way down every time
bro yes, thank you Minato
almost there!
because you are using 1.19.50? Why not just have a link to that one saved to your bookmark then???
I've never seen that page before, I go directly to the page you ended up on. Edit your link.
i use multiple versions
world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry }) => {
blockComponentRegistry.registerCustomComponent("mh:pedestal_interact", {
onInteract: (({ player, block, dimension }) => {
pEquipment = player.getComponent('equippable')
itemStack = pEquipment.getEquipment(server.EquipmentSlot.Mainhand)
const entity = dimension.getEntities({ closest: 1, location: block.location, maxDistance: 1.5, families: [`pedestal_hold`] })[0]
if (entity) {
if (itemStack) {
giveItemToPillar(player, entity)
} else {
takeItemFromPillar(player, entity)
}
}
})
})
});
what did i do wrong?
you should use the typings tbh they are good enough that there is no reason to use the docs
i do but some times i just want to search for info
making a file and setup just for that info is not a good idea
can someone help me with this?
its definetly a good idea, if you don't want to always make the setup, have it globally or use a tool for it
it says it there you gotta rejoin
import { world } from "@minecraft/server";
world.beforeEvents.chatSend.subscribe((data) => {
const player = data.sender;
const message = data.message;
if (message.toLowerCase().includes("woy")) {
player.runCommandAsync('tag @s add woy_tagged');
player.sendMessage("You have been tagged with 'woy_tagged'!");
}
});
Compiler found 1 errors:
[36mha1.js[0m:[33m3[0m:[33m20[0m - [31merror[0m[30m TS2339: [0mProperty 'chat' does not exist on type 'WorldBeforeEvents'.
[7m3[0m world.beforeEvents.chat.subscribe((data) => {
[7m [0m [31m ~~~~[0m
With what should i replace chatsend for it to work
It should give me tag when i send massage in chat
Does anyone know if something changed in OnPlace custom component?
I had a block that altered other blocks in chain using OnPlace, but it seems that the blocks that are placed by the script do not seem to work with OnPlace in the latest version
Documentation for @minecraft/server
I don't want to sound bad, but what does that answer my question?
theyve changed how its registered
itemtype and blocktype as far as i know
like itemcomponent and blockcomponent
just change it to register as world.beforeEvents.worldInitialize.subscribe(initEvent => {
initEvent.blockComponentRegistry.registerCustomComponent('namespace:custom_component', {
Oh, I already did that, the only problem I have is with OnPlace, which as I said, doesn't seem to work with blocks placed by scripts?
It's weird
is it a stair script?
did u update the version?
The idea is that when you place it, it changes to the pointed dripstone above it, and when its place it, it would also have an OnPlace event that would change the one above it again, and so on.
In the previous version, in 1.21.10, it worked perfectly, but now it doesn't work at all, for some reason if the block is placed by a script, using block.above().setPermutation(block.above().permutation.withState('state:lol', 'value lol')) (or something like that), the OnPlace does not seems to work
let me see if mine works
yeah mine is with commands
its because its split now
instead of the registery being a set one its now item and block
the next update will probably fix that
damn
I guess I'll have to wait
i mean my stairs work but idk if thatl help with your dripstone
stairs are just on place with no comands
The stalactite works well if it is placed by the player, but when it comes to changing the other blocks it is already ruined for the same reason I said, so I highly doubt there is a solution there.
Only change the first block, since the block placed was by the player, but the other block does not change the others when placed by the script
are they both in a seperate script?
Does anyone know how to fix this error?
const blockview = player.getBlockFromViewDirection().block
;?
Yes, but they technically work the same.
why not just copy paste as a seperate name in the same script and change it for whatever the dripstone needs
I'm going to do it, only when I did it I was a little lazy lol
lmao im just as lazy. i prefer hands on learning rather than looking at a boring 30min video
Conditionally check getBlockFromViewDirection() then get the Block if valid.
Yeah, they still work the same, so I just have to use a block.typeId and that's it xD
see. never know till you try
like this?
How should I check if it is valid or not? I already set it to return undefined in case it does, but it didn't work.
dont feel bad im still stuck on basic scripting lol but since the update im also having issues getting things to work and im too lazy to read which makes it harder i guess lol
Likewise, I'm going to have to wait for the previous problem to be fixed, because a current solution, I honestly can't find it, I was creating a recreation of the redstone, and I'm practically going to have to delay it because of that (unless I use OnTick 💀 )
@remote oyster
Yes, it usually happens
every time i learn something it changes
And sometimes you want to know something a little specific, and then things get complicated.
And when you ask, they send you to the documentation which doesn't say much lol
and im just trying to get a perm change with using an item lmao
i feel like im 5 again
const blockview = player.getBlockFromViewDirection()?.block;
Real
and what about this error?
You are attempting to access a location that is in an unloaded area. Meaning that there is no active player in that location for that chunk to be loaded in the world, therefore making it unreachable.
ok
thanks
love you
👍
squenkwark
Squidweenie
is it not possible to change textures with a permutation?
Not sure anyone answered you, I scrolled down some and did not see anything. Chatsend is still in beta. and make sure your npm's are updated to the latest.
is there any way to get broken block location?
Yes it is
the location of the block in this class. https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server_1_13_0.BlockComponentPlayerDestroyEvent.html
i want to implement this inside custom component
Hi excuse, I'm trying to replicate the same task of hammer 3x3 well in this case 3x1 HAHAHA, but I have a issue
If I break the block in this direction is working fine
but If I change the direction is working weird haha
I know that I need to adapt the direction of the player to the block is looking for but I don't have any idea
3x3x3
well it looks like that's only 3x3
yep, only thing I need is that this works like this
in every direction
oh
on interact with block the face tells you alot, player facing, is not always right as they can kinda stand at an angle
so in this case I need to adapt this to the player's view direction?
They hit a block, that block has a face... use that
the blockfacelocation and the head's location
oh okay
Just rotation- face location would be used for interact (not really for break, unless you feel like it)
id just make explosion on le bloc
what are you using now for the one direction that works
and maybe make a post so all the help in one place with no interuptions
got it haha
ok guys, he made the post, if you can go help him in there... I gotta move my car back into garage and I am so sore from cleaning garage all day, that I may not make it back to the computer....
so got my script stable and block set up but i still cant change the permutation with the script -_-
Explosion: yes. Boat: maybe.
A very light maybe
What does it say when you hover over it?
is there a way to make an entity be killed and still drop it's items with scripting with native? applyDamage and kill seem to not do it
very long msg
whatcha mean by drop its items
You might need to override the module that the UI module is using
with script api
isnt that a loot table thing in json?
well yeah but do i just spawn in the loottable?
it did for me
okay
i had this?
randomy entity is just one between these
in a radius
that does not drop anything
can you put random items around and see if it doesnt disappear
they do not

well it was a debug stick that required the player to hit the entity to instakill em
ig that makes it different
hm
wait let me test something
nope
thought i'd hit it first before it gets killed
maybe it dropped the loot but no
what did you use to kill it?
maybe try defining damagingEntity to yourself
entityHitEntity event
i cannot its on a block component
there is no player its just the block and the random entity
you could still do world.getAllPlayers()
rip
yeah but .kill()?
override damage?
applyDamage with override damage cause
hows that going?
doesnt
world.afterEvents.playerInteractWithEntity.subscribe(({itemStack, player, target}) => {
if (itemStack.typeId !== 'minecraft:stick') return
target.kill()
})```
you
put return there
!==
lol
system.runInterval(() => {
const dim = world.getDimension('overworld');
for (const entity of dim.getEntities({ excludeTypes: [ "minecraft:player", "minecraft:item" ] })) {
entity.kill();
}
});
idk what are you doing
maybe you turned item drop gamerule off?
doEntityDrop?
yes
probably that

i dont even have extra packs
new world time

lol
Hillo
hi
any good way of making expandable boundary’s with scripts?
what is that @viral plaza
expanding a bounding box...
Is there any expedient to cancel entityhit?
knockback is same?
sorry?
I also got this error, when doing getBlockFromViewDirection(). This error actually happens when you look at the air, and it can't get the block. So to fix it, you have to do a try{} catch{}
No need to do try/catch.
why
You can just grab the block, if block is undefined return
Try Catch should be used if you plan to do something with the error
putting this code will fix it then:
const getBlock = player.getBlockFromViewDirecton();
if (getBlock === undefined) return;
okie
So this? :
if (getBlock === undefined) return;
Nah I like to catch the errors just to throw them again
So @minecraft/server-ui has a listed dependency on a particular version of @minecraft/server. Since typescript is smart it's trying to tell you "hey, just so you know there's some differences between the Player class that you're passing in and the Player class that existed in the version of @minecraft/server that server-ui is expecting.
Since server-ui doesn't actually call any methods on Player you don't need to care about those differences and you can add this to your package.json and then do another npm install:
"overrides": {
"@minecraft/server": "$@minecraft/server"
}
Which tells node "all packages that rely on a version of @minecraft/server should use the version I have specified in package.json
try { throw “err” } catch(err) { throw err }
That's how the error feels after thinking it was safely caught
Then nest it 10x
try{}
catch(_error){
throw new Error("Unhelpful generic error.");
}
LOL
That should be put on a T-shirt 🤪
tysm
does anyone know what the type id for snow is
ive tried minecraft:snow and just snow but neither work
snow_layer maybe
can look in the blocks.json file for the samples on the github... or the npm for vanilla-data in the lib folder -> index.js ( tho need to quick format the file first)
Can anyone make me a script that can detect when my custom block is moved by a piston and then execute a command that summon a tnt right below my block (like the tnt glitch in java (with flying machines))
Or atleast guide a little
And tell me whats wrong with this script: `import { world, BlockType, MinecraftBlockTypes } from "@minecraft/server";
// Function to monitor piston pushing the custom block
world.events.blockPistonPush.subscribe((event) => {
const block = event.block;
// Check if the pushed block is the custom TNT block
if (block.type.id === "mc:tnt") {
// Get the position of the block below the current block
const belowPosition = { x: block.x, y: block.y - 1, z: block.z };
// Set the block below to a Minecraft TNT block
const belowBlock = world.getDimension("overworld").getBlock(belowPosition);
belowBlock.setType(MinecraftBlockTypes.tnt);
}
});
`
I need help with yaw rotation of an entity with custom pathing. This should rotate based on a circle path/position in the circle
const radius = 40;
const step = (2 * Math.PI) / 360;
let i = 0;
const rotateEntity = (i: number) => {
const yTheta = center.z + radius * Math.sin((Math.PI / 60) * i);
return yTheta;
};```
It's currently doing this
it was snow_layer, thanks!

aint you supposed to use x and z?
well i dont know thats why im asking but the setRotation method requires a x and y
setRotation requires pitch (x) and yaw (y)
usually when math get complex i just ask chatgpt
ill give it a try
just make sure to add comments to the code so it does know what you re trying to do
im trying to use setRotation too, im tryna turn around a player. but i cant get it to work, has no errors.
let rot = player.getRotation()
player.setRotation({x: rot.x - 180, y: 90})```
entity.setRotation() doesnt work on players
aawww hahah ok so .teleport is next to try
is it possible like make a block interactable and after interact it transforms but is not interactable anymore?
Put the interact custom component in a permtuation
How do I make apply knock back pull towards someone who use a sword
I try it now, and it just makes them go upwards like bunnyhopp
ok
@umbral sun Not sure what do you mean API handling it automaticly, bc you still need to do it on your own and thats slow
its just a difference between 32k string and 2,147,483,647 bytes long array
its 2T its theory
also you can save some values by bits so its memory efficient as well
Wrong guy 😅
there are 4 parameters, first two are 2 axis of direction (X, Z)
and seconds are horizontal strength and vertical
if you combine well then you have what you need
Np its not just the English tho, Coding is kinda hard topic as its a new thing, and you can't really compare programming to something different
Yes
You can register a custom component for your item in case it is custom, or if its vanilla you can just listen to the
itemCompleteUse event
Hi, excuse I only have 1 question
I'm creating a custom pickaxe but I need to specify every block with the speed that will be break?
for example, stone, speed: 20, diamond_ore, speed 15, etc?
there's not a simple way?
I think you can use block tags instead of the specific id
what's that? Sorry im new
For example, all of the dirt blocks (dirt, grass, grass path, etc) have the grass tag
oh okay, do u know where I can find the tags?
{
"speed": 12,
//Block will be breakable with this item
"block": {
"tags": "query.any_tag('stone')"
}
},
Example:```json
{
"block": {
"tags": "(query.any_tag('stone','metal', 'cobblestone', 'bricks', 'iron_pick_diggable'))"
},
"speed": 10
}
Oh thank you so much
I appreciate it
this just a general question but
what's better Microsoft Learn or Bedrock Dev for documentation?
Both are good
Both should be used. Bedrock.dev for quick lookup, ms docs for in depth explanation. And then the wiki has tutorials
How to make item go down by one when use?
Can't get worldInitialize to work. What are the common issues?
Any content log?
Not at all
module version is 1.13.0
Check API resources, I believe someone made something for durability....may have hints in there.
or do you mean itemStack count...?
Yes on the on use thing
I would use run command but it might cause issue
I mean how to decrement item stack by 1 like how the event used to do
itemStack.amount -= 1
container.setItem(slot,itemStack)
Thank you
Show code
the script?
No, your ip address
not funny could be the manifest
Why would the manifest be the problem if you are specificly talking about the worldInitialize event?
You tell me 😭. Anyways, I dont really have a code I just tried a bunch of things and none of them worked
Im lost
it is classified document
Not the entire code, just that one line
For example```js
world.afterEvents.worldInitialize.subscribe(() => {});
Is that what you are doing?
that was a joke lol
he said no error
Epic
Maybe he is trying to send a message or a form in worldInitialize not realizing it fires before the loading screen is gone
@ionic kayak
put
console.warn("this world have this script enabled")
in the root of your script
and another one inside worldInitialize
before any if condition
and reload
Thank you very much its working now
I was using 1.13.0 changed it to 1.14.0-beta and it worked
couldn’t be me …
nothing happens still
If you have it in a different file, make sure you are importing it correctly

