#Script API General
1 messages · Page 112 of 1
I just need the lightning bolt skill, so I can complete my mob
Respectfully, do it yourself
not create it for you
is there no script native way to use the tickingArea command?
this isn’t a place to be spoon-fed code, it’s a place to learn
-# These messages remind me of when I was new :D
Well that's sad, thanks though
We can help you doing the whole thing (the theoretical part of it)
I alr know how, ty tho
Okay great, if you need help with the code part, ask us
(Not for the whole code)
Nice
Does anyone know how to use player.setRotation(), I am trying to use it but it's not working
it is locked for entities only
🤷♂️
btw, let currentValue = 'Default'; will never reset after leaving and rejoining the world, right?
like it will work similar to dynamicProperties, right?
Like Minato said.
If you want values that keep their current value, use dynamic properties
i think that'll be an issue for my script, lemme do some testing first, ill probably just use dynamic properties for it
Sure
yup, it is indeed bugged
i can fix the issue without having to use dynamic properties
lol
currentValue.includes(['Default', 'Cool']) is more than enough to fix the issue,
I dont think includes works like that...
includes([array of values]);
it doesn't
nvm it doesnt
but this one does ['Default', 'Cool'].includes(currentValue)
Yes
Is there a way to change the name of an NPC? I can't give it a name tag, and changing its display name doesn't change its acc entity.nameTag
Try this
Ight
is world.playMusic the same as world.playSound
seems that it isn't
so what is the equivalent of world.playSound now
its in the dimension class now.
ah thx
Yes, you can call player.addExperience() with a negative number.
oh
i just did this
is it basically the same
const remainingXP = xpComp - price;
player.resetLevel();
player.addExperience(remainingXP);
i assumed it doesnt work with a negative number since /xp doesn't either
You also need to remove any remaining XP, as reset level just removes all levels, and not any XP between level 0 & 1
Is there anyway to damage a durability using scripts?
Why am I just finding out addExperience() is a thing. Is it a new method? (Or at least released to stable recently)
ItemStack durability component -> change the .damage property value
A question what is the last manifesto of 1.21.101
On scripts or item json?
You'd need the durability component in JSON for custom items (https://learn.microsoft.com/en-us/minecraft/creator/reference/content/itemreference/examples/itemcomponents/minecraft_durability), and scripts can change the value of the durability
I need the thing to be used 6 times before it replace item(ill use json if possible)
Ohh ok
hi
???
runCommandAsync can be used with await?
Quick question see how there are tags on a item like a pickaxe for example
How do I get / find the whole list of tags like I know stuff like wood stone iron\pick_diggable but where to find the list of options ?
Is there a way to add custom tags to blocks when they are placed? Or a good way to distinguish between generated blocks and player placed blocks?
You could do block states.
would I have to add a custom state to every single block in the game?
Yeah.
heck, ok thanks
runCommandAsync does not exist on latest api anymore
use runCommand
and yes technicaly you can use await with anything
Alright thank you for clarifying
and put async in calllback (async => {
})
Installation for @minecraft/server
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
world.beforeEvents.chatSend.subscribe((event) => {
const { message, sender } = event;
if (!sender) return;
if (message.startsWith("!cratekey ")) {
event.cancel = true;
const keyName = message.split(" ")[1];
if (!keyName) {
sender.sendMessage("§cDùng: !cratekey <tên>");
return;
}
const inv = sender.getComponent("inventory")?.container;
const selectedSlot = sender.selectedSlotIndex;
let item = inv?.getItem(selectedSlot);
if (!item || item.typeId !== "minecraft:tripwire_hook") {
sender.sendMessage("§cCầm tripwire hook trên tay để thêm lore!");
return;
}
const lore = item.getLore() || [];
lore.push(`Crate: ${keyName.toLowerCase()}`);
item.setLore(lore);
inv.setItem(selectedSlot, item);
sender.sendMessage(`§aĐã tạo tripwire hook thành key cho crate: §e${keyName}`);
}
});
[Scripting][error]-ReferenceError: Native function [ItemStack::setLore] does not have required privileges. at <anonymous> (scripts/gacha.js:54)
How to fix ???
It’s a privilege error
means something is probably changing the world in a beforeevent or smth
ah classic error
Put a system run around the setlore
Oh thanks
makes it run inthe nexts vailable time
Yo sorry for bothering ya again
What script component(if that what its called) that can reduce the items durability?
its the same identifier as the JSON component
I see
Thanks
Could anyone help?
https://discord.com/channels/523663022053392405/1420400725350940773
Nevermind, it's not fixed
I don't think this is the correct channel
I could use some aid :3
well he meant entity id not uuid so this is the correct channel xd
Nah, the person above him and below me deleted their message
Btw, are component group switching more laggy/resource using than scripts?
Depends on, but scripts are better usually.
Yeah, makes sense
is it possible to make client sided entities?
much like roblox doors's glitched rush, ambush and screech
i am implementing something close to it
by client sided, i mean that they can only be seen by a player, they can only attack/interact with that player, and no one else.
not strictly ran on the client, cuz that's impossible
any help would be very appreciated. (ps. sorry for grammer and other stuff, i am kinda in a rush)
No. Only per client rendering.
hm
i guess i can try to work with that
but i was really hoping for a different answer
got any samples of how i'd do that?
Idk. Use setPropertyOverride per entoty.
uh what?
Ibxtoycat showed off the capabilitites a while back.
just make an entity with a property and client sync set to true
than use setPropertyOverrideForEntity
right but how do i change the rendering?
Render controllers.
ah
render control, or animation
what's the most performant?
i guess render controller
you too
It is unlikely to be preview day my dudes
Previews starting from March 11, 2025 will try to release on a Tuesday: https://bsky.app/profile/jorax.bsky.social/post/3lk4lhrpmoc2p
This is mine lol

is there a way to actively check if the player is punching a block?
Why is your keyboard so big?
Is there any better way to check when a block is touched by water that doesnt involves the scary ticking?
Considering it would have to be ran on the block, no
I think this is where you would want to just use existing components. "minecraft:liquid_detection"
is setCooldown for items v2? im using v1 stable and im getting errors from using it
i think its also in v1?
Why doesn't it work???
Screenshots are hard to read, and photos even more so. This is especially true if you are using bridge or another tree editor, as this format obscures the JSON format.
We can help you best if you copy and paste your code here, or send it directly as a file.
you havent defined health
const health = player.getComponent("health")```
Put it before the `player.sendMessage`
Aaaahhhh. Abusing TS.
public async SendInternalPacketAsync(
packet: InternalPacket
): Promise<{ Packet: InternalPacket; Entity?: Entity }> {
if (this._requests.has(packet.RequestId))
throw new Error(
`A request with the id ${packet.RequestId} already exists!`
);
this._requests.add(packet.RequestId);
this._writer.Reset();
packet.Serialize(this._writer);
const data = Z85.GetStringWithPadding(
this._writer.Data.slice(0, this._writer.Length)
);
system.sendScriptEvent(`vc:${packet.PacketType}`, data);
return this.GetInternalPacketResultAsync(packet.RequestId);
}
private async GetInternalPacketResultAsync(
requestId: string
): Promise<{ Packet: InternalPacket; Entity?: Entity }> {
let result: { Packet: InternalPacket; Entity?: Entity } | undefined =
undefined;
const callback = (ev: { Packet: InternalPacket; Entity?: Entity }) => {
if (ev.Packet.RequestId === requestId) result = ev;
};
this.OnInternalPacketReceived?.Subscribe(callback);
while (result === undefined) {
await system.waitTicks(1);
}
this.OnInternalPacketReceived?.Unsubscribe(callback);
this._requests.delete(requestId);
return result;
}
Ty
Can I use a scriptevent on a custom mob from a different addon as long as the scriptevent used exists?
your abusing the whole scripting by making the Subscribe property Pascal cased🙏
Collection of wonderful TypeScript type gymnastics code snippets. - g-plane/type-gymnastics
where do i ask about bedrock debugger
@distant tulipty
@distant tulip u should update the link of hacker's keyboard
also there is no 2.2.0 in the ver list
I will look into it
Any ideas about a 10MB limit on dynamic property write speed? Keeps coming up in BDS logs
can you send the message?
This is what it said. I'm guessing I know what it means, but it's none of my addons, though they probably contribute. There's a few addons used, some of which are... badly coded at best by others
What do u want now tho
That's a console warn, so... probably inside one of your packs somewhere?
Using a wrapper
is that a warning or an error tho
21 mb were saved last minute
Just a warn
I just got back into scripting after months and months. First thing I try is apply knockback but it's not working. Did they change my favorite thing to do? What's different now?
It said to use an XZ vector
So I tried
const dir = player.GetViewDirection();
player.applyKnockback([dir.x, dir.z], 3);
to test
but it didn't work either
I am so out of practice 😭
XZ Vector is {x:number,z:number}
So I would do
New format for apply KB is
applyKnockback({ x: x * hStrength, z: z * hStrength }, vStrength)
instead of applyKnockback(x, z, hStrength, vStrength)
([{x: dir.x, z:dir.z}], 3):
No square braces
Hmm, that's weird
I'm not familiar with how that will change things
Is the change an improvement or is it worse?
😭
If you translate it as above, there's no change
Thanks
OHH
wait
so normall I would do
(viewdir.x, viewdir.z, 2, 0)
but
that would js be
In previous versions that is what it would be, yes
({viewdir.x * 2, viewdir.z * 2}, 0);
Got changed a few updates back to the new format
({x: viewdir.x * 2, z: viewdir.z * 2}, 0);
would this be the exact uhh
Need the x & z object properties
oh yeah the x and z lol
Thanks!!!
Now I gotta uh
find something to make
smh
I'm making an RPG. Decided
New combat system and all
I'll probably stop abt 30% way thru
but
Good luck 🫡
I can dream
Thanks!
HA
IM BACK IN THE GAME
now I js gotta remember how to do literally everything else
also, first time seeing vibrant visuals and I hate it
My black concrete was light grey
Also, I lied. It did not function
OHH
nvm I realize
no i dont
I used that
and it says it expects 4 arguments??
It should just expect the vector and vertical strength
Using 1.19.0 in my @minecraft/server manifest
checking my game version now
I js installed minecraft so I assumed it should be the newest version
Running 1.21.101
Yeah 1.19.0 scripts still uses the old format
What's the current version?
Like what should I change it to?
2.1.0
You can keep using the old version, nothing wrong with that
It's stable, so it'll never change
ofc
Just won't get new features
I'll switch to 2.1 and see if that fixes things
So I could use the old applyKnockback on 1.19.0?
ya
ohhh
alright
well im trying 2.1.0 :)
Thanks again
I'm a talkative and questioning person, so I'm sure you'll see me again lol
LOTS
Knockback was changed in 2.0.0 stable version
Can use https://stirante.com/script/ to see script version features and compare versions
Thanks!
yeah its weird bc it's not letting me boost myself forward with my current script. The only thing it's doing is using the vertical strength

is there any way to detect when a player punches?
Are you walking forward when you use the stick?
nvm got itt
in preview, swing event
yeah but its still
yk
I got it to do smth when I removed the vel.x and vel.z
but its fixed to one direction
Makes sense
Console warn the velocity to debug it then
in preview 😔
yeah that worked
ill try to get velocity working
oh it does work
its js rlly weak so i gotta beef it up
I DID IT
I'M GETTING INTO THE GROOVE FR
I'll work on optimizing the code later
@woven loom
it is working fine?
world.beforeEvents.chatSend.subscribe((e) => {
const player = e.sender;
const msg = e.message;
system.run(() => {
if (msg.startsWith("!dash")) {
const slot = msg.slice(6);
player.sendMessage(`${slot}`);
}
})
})
Am I going crazy?
If you’re on stable chat send doesn’t exist
kill me now. What's the newest beta version? 😭
2.2.0-beta, if I remember correctly
Thanks dude 😭
Be warned the version changes very frequently (generally every major update) and stuff can change inside scripts without warning
Hence, beta
alright, thanks!
also
its
@minecraft/server-beta
or ```@minecraft/server@beta
Same as stable
so this should be correct?
yep
awesome
and if not, ill trial and error like a real man fr
yep we good :)
Ughhh
Trying to make it an integer rn
Ooo idea
YES
We do have slash command capabilities now, btw
We do?
Ya
How? 😭
system.beforeEvents.startup.subscribe(data => {
data.customCommandRegistry.registerCommand(
customCommand: CustomCommand,
callback: (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined,
):
})
Can set a lot of things
oh that's crazy
thanks!
Next goal!
Make this health bar actually work
It's js an actionbar with a bunch of |||| and some colors lol
now to the easy part, json ui
I HATE json ui
nor will I ever use it lol
been there
not sure about that lol
i use json ui now
Wow
I'd love to but
When I first tried it
It about made my brain explode
yeah it is hard to learn
Eh. I made my own custom event handler and invoker so that's why.
Real
Are we sure this isn't a Bedrock warning/error? I don't know what pack it is, it'd be great to find out, but yeah, no apparent issues
Ah, apparently it is a thing, yeah
Concerning... This feels really bad. No clue what Addon would be doing that
Guys i need help on ItemDurabilityComponent Class
So im trying to make a script that everytime i use an item the durability would go down
import { world, ItemStack, EntityInventoryComponent, EntityComponentTypes, ItemDurabilityComponent, DimensionLocation } from '@minecraft/server';
world.afterEvents.itemUse.subscribe(({ source: player, itemstack }) => {
switch (itemstack.typeId) {
case 'vdg:coltwalker'
}
})
Uhh
What do i do next
What happens if I subscribe 10000 eventTypes/ entityTypes in afterDataDrivenTrigger?
is it still not possible to make the player open an entity gui?
Wdym
I think it explains clearly
Like subscribing to events inside of data driven trigger? Or having multiple subscriptions to data driven trigger?
it is options after subscribe call back
what is this?
an IPC API for handling multiple addons communicating with an external application.
you mean addons talking to a server?
addons talking to each other
i was thinking in a protocol to do so these days, since im implementing quic
i've written an specification
Addons talking to a central addon talking to an external server
why are you doing this? i mean, theres the IPC of that guy i forgot the name and a lib of mine
it's a good project though
All I wanted was something that doesn't care what environment I have to use. Heck I can even get it to talk through socket io, websockets, dp's. Anything
All it cares is converting a packet to a string and vice versa.
It doesn't care about the transport
the idea of what i was thinking of was something similar
a way to simply establish connections and send raw bytes
in fact i was thinking in a way of using the less amount of scriptevent calls as possible
so i had to think on a way to send multiple requests to one end, and be able to make so for various ends per scriptevent call
thanks to quic
you could technically do only one call
yeah, the idea is really this
one scriptevent call sends N requests to 1 Addon, and can do this to N addons
i just wanted to know what are the weaknesses of the ipc project to really have a reason to implement so
on mine is that it aint got this multiplexing, it sends 1 request per scriptevent, or per N scriptevent calls if the size is too big since it was made when script event did limit the size to 2kb
scriptevent command doesnt have the limit for some unknowable reason
also im checking the docs rn and theres no mention of limit in .sendScriptEvent() now
Guys i need help
How do i make my script damage the durability of my item when i use it
i wonder if the limit is actually gone?
they removed
I alr made this a while
Idk what to do next
it had, now you can send any amount of data you like
so it is actually unlimited now?
yeah
lovely
thats why im thinking on the project to start with 8kb but connectiond be able to handle more or less
i really just need to have a reason to implement
@slow walrus youre implementing this in 3.1.0 branch of MCBE-IPC, right?
did the game update?
wait, youre waiting for an update?
i thought you were still working on it
it does
it does???
yes, the limit is being removed in .110
oh
yeah it's never been mentioned
my code?
weird, i could send about 65kb of chars
probably in the id?
no
the message itself
imma test it again and show you later
im at cellphone right now
yeah you should test it again
anyway what about the code isn't understandable?
im interested if I need to make stuff more clear
i dont understand how you send the data
like the format?
the serialization and de serialization is comprehensive
yeah
well it's binary data that gets turned into a utf16 string
so 2 bytes to one utf16 character
that's pretty much it
no way
maybe its cause i've implemented it using arrays instead
just used the buffers and thats it
the id uses the format (0xHEX) where HEX is the binary data of the header in ofc hex codes
oh thats why i didnt understand
yeah the id is very limited in the characters it supports so it can't use the same format as the data
does the id have limitations? really?
yes
@slow walrus
import {world, system} from "@minecraft/server";
const text = "a".repeat(8192);
world.afterEvents.playerButtonInput.subscribe(e => {
system.sendScriptEvent("test:data", text);
console.warn("Sent", text.length, "chars");
})```
addon1
```js
import {system} from "@minecraft/server";
system.afterEvents.scriptEventReceive.subscribe(e => {
console.warn(e.message);
console.warn("Received: ", e.message.length, "chars");
});```
addon2
dont try to allocate 256mb of memory guys
why in hell would some use this?
I accidentally did it for some custom even handler I made. The world ran but it would get progressively worse.
Oh yeah that was it. I just forgot the await
8 mega tf
bro what is the point of this
You can go up to 2gb total though
this shit might use shared memory
what mc version are you on?
of so they limit using int
16 or 32 bit?
Oh yeah C# is the same. That ain't new to me
where's the first console warn of the second addon?
import {system} from "@minecraft/server";
system.afterEvents.scriptEventReceive.subscribe(e => {
console.warn("Received: ", e.message.length, "chars");
})
holy shit i tried to console log 8mb string
i forgot to save the change to 4kb
on the receiver one
import {system} from "@minecraft/server";
system.afterEvents.scriptEventReceive.subscribe(e => {
console.warn(e.message);
console.warn("Received: ", e.message.length, "chars");
})```
i really wonder what is the difficulty of adding an 'unsigned' in front of it
to double the amount possible
hugh I guess the limit got removed in .101 then
looks like fragmenting will still be needed though, sending heaps of data at once causes lag spikes
fragmentation will always be required in fact
bruh I'm dumb lmao
thought the job system broke
but it was just cause I was doing "a".repeat(200000) each time instead of caching it
yeah nevermind it doesn't really need fragmentation
nvm it does
the main problem would be to transform from string to bytes
since strings are immutable, theyre cloned everytime
What does ev mean in script
probably the engine uses some kind of caching and shared memory because i only started to face problems when i sent about 8mb
Wdym?
Like when people do
subscribe((ev) => {
xx
})
Probably eval, I'm not really sure
But
"ev" could be anything
You could type "dog" and it work js as fine
Idk my friend never made it a variable or const
Ye he made my script because idk anything abt scripts
it's short for event
it's more common for it to just be called e
how can I get the rider's x and y head rotation and apply it in animations to my entity ?
I see
Query.target_x_rotation?
ev is the name of the parameter, i personally use it like 'ev' because it stands for 'event'
(ARGUMENTS_GO_HERE) => {BODY_GO_HERE}
this is an anonymous function
function name_of_function(argument){
dothing()
}
something.subscrive(name_of_function)
this does the same as if it was using an anoymous function
i'm learning javascript from being forced to use the script api 😭
What's the easiest way to test addons for BDS that need server-net? Do I just run a server locally and develop in the development directories?
nah i want it in script not direclty like that
yep, can't enable server-net on client unfortunately
As in, do I just run the server locally and develop inside its directory, then use /reload?
yeah that should work
Also, any ideas on how to get the first tick a player is able to see in the world? I tried playerSpawn after event, but it triggers about 1-3 seconds before they can actually see on realms
world initialize after event
Oh so that gets called after playerSpawn? that's so weird, ty
Ah
i dont think thats possible?
but maybe you could try to use server form to constantly check if the user is busy
just a random idea tho, cant guarantee
Alright, thank you!
Hmm what are your thoughts on pressureplate event where they spawn on the pressureplate? Would it likely still trigger before they can see? I'm not very familliar with world loading (https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server.WorldAfterEvents.html#pressureplatepush)
the player actually spawns way before the player can play
hence why the playerSpawn event happens early
Hmm. Would their targetted block be null if they can't see?
I'm gonna have to go set up my PS5 or something to test
eh i doubt it
Maybe vibrant visuals delays the load time more
I thinks it’s been changed to world load
But still that probably wouldn’t work
unless you could find a consistent way to use a delay or something
I actually found some really weird Bedrock quirk. If run in any timeout it breaks, but doing it immediately in a system run, it works just fine. Thanks!
Sorry for all the questions, I just saw on a server that you can change a player's render distance? I feel like at this point I've read through every major doc possible, but did I miss something to enable this?
Oh unless it's geyser?
whuh
idk if thats possible at all????
Yeah that's not possible with scripts
Render distance is a server/world property, and a client thing as well
For the setCamera option, I'm confused as to the method. It's setCamera(cameraPreset:string, setOptions?: then lists a bunch of options)
If I wanted to do camera roeset then only update CameraSetFacingOptions would I js do
setCamera("minecraft:third_person", CameraSetFacingOptions: wtv)
woah nvm
I got it I think
system.runInterval(() => {
const players = world.getAllPlayers().forEach((player) => {
const hand = player.getComponent("equippable").getEquipmentSlot("Mainhand");
if (hand.getItem()?.typeId == "minecraft:stick") {
const playLoc = player.location;
const viewDir = player.getViewDirection();
player.teleport({x: viewDir.x + 1, y: playLoc.y, z: viewDir.z + 1});
}
})
}, 0)
How would I change this to teleport me 1 block forward to whichever direction I'm facing?
I tried playLoc * viewDir + 1
I don't get how I could implement viewDir though. It's a rotation
And added + 1 to playLoc is js coords and can't be kept like
idek
And with the new updates since I've joined, is there a way to track movement inputs, like if ur holding A or moving ur joystick left?
without riding an entity
player.teleport({
x: playLoc.x + viewDir.x,
y: playLoc.y,
z: playLoc.z + viewDir.z
});```
oh add instead of multiply
thats simpler than I thought lol
wait then
How do you control how many blocks?
You can also throw in * distance on the end and create a const if you want to change how much distance you move
ohhhh
Was just getting to that lol
thanks so much
yeah oops
No problem ha
#1421307791993339974 Can anyone help me fix this
can local worlds use @minecraft/debug-utilities
Hm? Yes
What is the size limit for a dynamic property?
32Kb
32k bytes more speceficlly 32,767
Installation for @minecraft/server-ui
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
If you want it to contain more data you can use base62 for encoding
that's worse
well ig it depends what the data is
if it's raw binary that just convert it directly to a utf8 string
not sure how the game handles control chars in dynamic properties but hopefully it doesn't do anything weird
as long as its not a null byte, it interprets as normal char
else it interprets as termination char, and ends tje string at there
and actually js strings are utf16, not utf8
Installation for @minecraft/server
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
i know, but they get converted to utf8, so 32767 bytes of ut16 in JS might be more when it's actually aaved
cause c++ uses utf8 strings
https://stackoverflow.com/a/1010785
does the engine use another kind of string? i thought it only appended thr bytes
I am trying to convert a C++ std::string to UTF-8 or std::wstring without losing information (consider a string that contains non-ASCII characters).
According to http://forums.sun.com/thread.jspa?
No
Has it been this long since I've used if statements 😭
else if
Yeah it's a python thing
ohh I see
Wait, you actually can't get the location from an explosion event? Maybe I just take all the blocks, average and hope for the best? https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/explosionbeforeevent?view=minecraft-bedrock-stable
system.runInterval(() => {
world.getAllPlayers().forEach((player) => {
const hand = player.getComponent("equippable").getEquipmentSlot("Mainhand");
if (hand.getItem()?.typeId == "minecraft:stick") {
const viewDir = player.getViewDirection();
const speed = player.getDynamicProperty("speed");
player.applyKnockback({x: viewDir.x * speed, z: viewDir.z * speed}, 0);
if (player.isJumping) {player.setDynamicProperty("action", 0)}
else if (player.isSneaking) {player.setDynamicProperty("action", 1)}
else if (player.isSprinting) {player.setDynamicProperty("action", 2)}
else {player.setDynamicProperty("action", 0)};
player.onScreenDisplay.setActionBar(`${Math.round(speed * 10)/10}`);
switch(player.getDynamicProperty("action")) {
case 0:
if (speed <= 0.4) {player.setDynamicProperty("speed", 0)}
else {player.setDynamicProperty("speed", speed - 0.4)}
case 1:
if (speed <= 0.05) {player.setDynamicProperty("speed", 0)}
else {player.setDynamicProperty("speed", speed - 0.05)}
case 2:
if (speed >= 2) {player.setDynamicProperty("speed", 2)}
else {player.setDynamicProperty("speed", speed + 0.08)}
}
}
})
})
It's continuing to increase my speed
even when I'm shifting
Now it's stuck at max speed
How can I fix this?
Or should I put it as it's own forum? 😭
I have a code that works, but I tried consensing it this way
world.sendMessage(event.itemStack.hasComponent("minecraft:food"))})```
does anyone know why this is always returning false even when im eating food?
that component only work on some items
apples for example
u mean on only some food items? cuz i tried it with eating bread and the result was false
I'm really struggling to get the camera to fade to white:
player.camera.fade({fadeColor: {red: 255, green: 255, blue: 255}, fadeTime: {fadeInTime: 0.2, holdTime: 1, fadeOutTime: 3}}); // Error value must be 0-1.0
player.camera.fade({fadeColor: {red: 1, green: 1, blue: 1}, fadeTime: {fadeInTime: 0.2, holdTime: 1, fadeOutTime: 3}}); // Fades to black
player.camera.fade({fadeColor: {red: 0, green: 0, blue: 0}, fadeTime: {fadeInTime: 0.2, holdTime: 1, fadeOutTime: 3}}); // Also Fades to black
player.camera.fade({fadeColor: {red: 0, green: 1, blue: 0}, fadeTime: {fadeInTime: 0.2, holdTime: 1, fadeOutTime: 3}}); // ALSO Fades to black
I have a feeling it's to do with this, but I can't find opacity https://learn.microsoft.com/en-us/minecraft/creator/documents/camerasystem/cameracommandintroduction?view=minecraft-bedrock-stable#:~:text=The target opacity of the fade is always fully opaque. If this is not specified%2C it will use 0 for each value%2C which causes a fade to black.
AH found the issue. For anyone else seeing this, Vibrant Visuals MUST be off to see camera fades
Yeh. VV messes with it for some reason
oh so thats why it was always turning black
is that inntentional?
Probably not
could I impliment a sql database into mc?
Im talking about a local database stored in .sql files
can you use the native file related js features in scripting api?
i just looked it up it only has limited access to node features
but using server net and http requests is slow asf
mhmm, 'tis what it is as of now
is there a limit to the amount of dynamic properties i can have?
somewhere around 32k bytes
thats the limit of data for a single property, i mean how many different dynamic properties can i have?
as much as u want ig
but itll affect the game
u might also wana utilize structureManager for better minecraft data stuff
you any good at geomatry?
wdym
im asking if youre good at geomatry like vector related stuff
uhm, not really, but i like playing with em
alright nevermind then
I'm seeing something really weird when spawning my custom entity.
Image 1 is this code, where it spawns a little in the air, but centered on the block.
let toSpawn = ev.block.center();
let newTNT = ev.player.dimension.spawnEntity(block, toSpawn);
Image 2 is with a small adjustment to move it down a little bit, and it also shifts the X to +1. I've tried also correcting the X, but it snaps either side of the block.
let toSpawn = ev.block.center();
toSpawn.y -= 0.5;
let newTNT = ev.player.dimension.spawnEntity(block, toSpawn);
Is it possible to use RawMessage on CustomCommandResult?
I know its possible to do { status: CustomCommandStatus.Success, message: "translated.message" }, but is it possible to do RawMessage?
it only accepts string, so i doubt it
Ah, thanks for the answer
Hope they will add RawMessage support in future update
how to convert movement speed into speed multiplier?
Wdym i cant?
import { world, ItemStack, DimensionLocation } from "@minecraft/server"
const TARGET_ITEM = "vdg:coltwalker" // target item ID
const DAMAGE_PER_USE = 1 // durability consumed per use
const USE_ITEM = world.getDynamicProperty("vd:shooting")
world.afterEvents.itemUse.subscribe(ev => {
const { source: player, itemStack } = ev
if (!player || !itemStack) return
if (itemStack.typeId !== TARGET_ITEM) return
if (USE_ITEM == false) return
const dur = itemStack.getComponent("minecraft:durability")
if (!dur) return
if (dur == 0
) system.run(() => player.runCommand('function coltwalker/empty'))
dur.damage += DAMAGE_PER_USE
const container = player.getComponent("minecraft:inventory")?.container
if (!container) return
container.setItem(player.selectedSlotIndex, itemStack)
});
console.warn
The shiiit code in question..
That's an interface, not an actual JS object
Huh
Wym by that?
Do i need the get dynamic property or no
I just need it to return when my property is false
import { world, system, ItemStack } from "@minecraft/server"
const TARGET_ITEM = "vdg:coltwalker" // target item ID
const DAMAGE_PER_USE = 1 // durability consumed per use
const USE_ITEM = world.getDynamicProperty("vd:shooting")
world.afterEvents.itemUse.subscribe(ev => {
const { source: player, itemStack } = ev
if (!player || !itemStack) return
if (itemStack.typeId !== TARGET_ITEM) return
if (USE_ITEM == false) return
const dur = itemStack.getComponent("minecraft:durability")
if (!dur) return;
if (dur.damage == 0) system.run(() => player.runCommand('function coltwalker/empty'))
dur.damage += DAMAGE_PER_USE
const container = player.getComponent("minecraft:inventory")?.container
if (!container) return
container.setItem(player.selectedSlotIndex, itemStack)
});
Debug result for [code](#1067535608660107284 message)
Compiler found 2 errors:
[36m<REPL0>.js[0m:[33m15[0m:[33m7[0m - [31merror[0m[30m TS2367: [0mThis comparison appears to be unintentional because the types 'ItemDurabilityComponent' and 'number' have no overlap.
[7m15[0m if (dur == 0
[7m [0m [31m ~~~~~~~~[0m
``````ansi
[36m<REPL0>.js[0m:[33m16[0m:[33m5[0m - [31merror[0m[30m TS2304: [0mCannot find name 'system'.
[7m16[0m ) system.run(() => player.runCommand('function coltwalker/empty'))
[7m [0m [31m ~~~~~~[0m
There are no errors from ESLint.
Not cooked but incinerated i guess
No errors in [code](#1067535608660107284 message)
try that
Uhh
What are the required privilages?
Idk im just following things on script documentation
Thats the code
do smth like
let USE_ITEM;
world.afterEvents.worldInitialize.subscribe(() => {
USE_ITEM = world.getDynamicProperty('...')
})
or, it's even better to fetch the dynamic property inside the itemUse event itself (in your context)
worldInitialize removed -> its worldLoad
Ik you've been off from scripting from a while xD
Oh yea forgot it
I did do scripting after 2.0.0 but I've been off for like 2 months
guys is it possible to transform 1 mob to another mob?
undercertain conditions
for eg the health comp being less than 10
or smth like that
Remove it and spawn an entity in its place.
Ohhh ok
not node, but quick
i can provide you the doc of quick, but we cannot use it
what you can do is use dynamicProperties as the storage system
but that'd be inefficient as hell
isnt that limit based on tje length of tje string? i mean, u can have 32k chars, but as js uses utf16 its about 65k
Is this good chat
Damage capping
https://streamable.com/8jerix
yo dyk why it only works on some foods and if theres a way to check if an item is a food item
im not sure myself as well, idek if theres any accurate docs abt it
Does anyone know why this code is not working?
import { world, system, Player } from "@minecraft/server";
world.afterEvents.entityHurt.subscribe((event => {
const hurt = event.hurtEntity;
if (hurt.hasTag(hurt0)) {
hurt.removeTag(hurt0);
hurt.addTag(hurt1);
} else if (hurt.hasTag(hurt1)) {
hurt.removeTag(hurt1);
hurt.addTag(hurt2);
} else if (hurt.hasTag(hurt2)) {
hurt.removeTag(hurt2);
hurt.addTag(hurt3);
} else (hurt.hasTag(hurt3)) {
hurt.removeTag(hurt3);
hurt.addTag(hurt4);
}
)}; ```
are those tags declared, or do u mean them to be string?
Well, I thought that hasTag(tag) would check directly in the game if the entity has the described tag
if there's const tag = "something", then itll refer to the variable
u can use "hurt3" as well if ud like
I don't have
ok, then make em strings like
hurt.removeTag("hurt1");
hurt.addTag("hurt2");
import { world, system, Player } from "@minecraft/server";
world.afterEvents.entityHurt.subscribe(event => {
const hurt = event.hurtEntity;
const hurtTag = hurt.getTags().find(tag => tag.startsWith("hurt"));
if (!hurtTag) return;
const hurtX = hurtTag[4]; // 5th char or index 4
hurt.removeTag(hurtTag);
hurt.addTag(`hurt${parseInt(hurtX) + 1}`);
//other code to handle 4+...
});
@pallid stag there's still js syntax u gona have to learn btw
Bro
I already fixed it, it was a syntax error, plus I didn't put the "" in the tag
🤡
Anyway, thank you very much for helping.
np 
wait why
There's no source or location on the event, just cancel and impacted blocks
set the impacted blocks to an empty list and subscribe to the respective afterevent
you might be able to grab the entity's location
I'm not worried enough to make a workaround when .location should just be a thing normally
yeah
minecraft explosions originate at a specific coordinate that is definitely passed in somewhere
no idea why it isn't kept and passed into callbacks
Maybe I missed something but the docs have nothing
anybody here good at geomatry?
Slightly different question, I'm trying to lock the camera for like a 2D camera movement where it can only be up and down. setRotation seemingly doesn't work for players, and teleport is all glitchy because we can't maintain velocity. Ideas?
system.runInterval(() => {
for (const player of world.getPlayers()) {
player.setRotation({x:player.getRotation().x, y: 0});
}
}, 1);
whats the question
Use the camera command.
Oh wait really, I thought that was only visual? I would need the actual camera to be elsewhere but the player can only look at a vertical row of blocks
Camera command + control scheme if that's what you want.
What is this????!!!
I tried disabling left right input, but then keeping the player's crosshair to only to vertical was the tough part. Teleporting worked but since they lose velocity it's too glitchy
The camera would be stationary elsewhere, so it's not just visuals, mostly the crosshair, kinda like terraria I guess
Yeah. I would toy around with control scheme and the camera command then. In 1.21.120 there is a scripting equivalent for the control scheme command.
AH awesome, thanks, I'll give that a go and see. The camera command is probably where it's at, just gotta keep learning!
Any one have any ideas as to why the js blockDistance constant from this script is returning as undefined?
Any help given is appreciated
world.afterEvents.itemStartUse.subscribe((e) => {
const { itemStack, source } = e;
const player = source;
const item = itemStack.typeId;
const type = "ltng:web_test";
const entity = player.getEntitiesFromViewDirection({ maxDistance: 75 })[0]?.entity;
const block = player.getBlockFromViewDirection({ maxDistance: 75 });
const blockDistance = distance(player, item, type, entity, block);
});
function distance(player, item, type, entity, block) {
if (block && !entity) return;
if (item !== type) return;
const blockLocation = block.block.location;
const headLoc = player.getHeadLocation();
const deltaBlock = {
x: blockLocation.x - headLoc.x,
y: blockLocation.y - headLoc.y,
z: blockLocation.z - headLoc.z
};
const blockDistance = Math.hypot(deltaBlock.x, deltaBlock.y, deltaBlock.z);
return blockDistance;
}```
Is it possible to make the player unable to attack?
Even if he clicks on the screen to hit the entity he can't
i know a way, but it requires player.json modification
Is it okay to remove console warns when done testing scripts?
unless youre using console.warn for specific cases like "this should not be undefined" or "this must be whatever type or the whole thing falls apart"
its ok to remove them
you can always add them back if you were to debug
hello guys
Does anyone know how to execute the command? For example, I wrote in caht !gmc to give me creative, I've tried several other things without using tags like creative survival etc., I want to do the commands using the code itself, even though I use runCommand(' gamemode creative, it doesn't work, does anyone have an idea that is w
Can you show your code?
Maybe it will better with animation controller
Hello Idol
may i ask abt something
what's the difference between runCommand and runCommandAsync
AE.itemUse.subscribe(({source:A,itemStack:B})=>{
if(B.typeId.includes("_axe")){A.runCommand("tp @e[type=item,r=24] @s")};
if(B.typeId.includes("_hoe")){A.runCommand("tp @e[type=item,r=24] @s")};
if(B.typeId.includes("_pickaxe")){A.runCommand("tp @e[type=item,r=24] @s")};
if(B.typeId.includes("_shovel")){A.runCommand("tp @e[type=item,r=24] @s")};
if(B.typeId.includes("_sword")){A.runCommand("tp @e[type=item,r=24] @s")};
});```
i figured it out using non-async fix the problem with my code
If I remember right, async has no delay
And does it the exact tick the code is ran
runCommandAsync got removed in the newer versions
Async simply means that the command can be awaited until its done. Also It put the commands in some sort of queue so you had a limit of 120 commands per tick or something like that
They removed it bcs most commands didn’t run async anyways
Or maybe none
oh alr
oh damn I was wrong lol
Thanks for the correction
Use an else if chain its better for perfomance
like "else if" right?
this is another way as well
const AE = world.afterEvents;
const equipmentRegex = /_(axe|hoe|pickaxe|shovel|sword)/;
AE.itemUse.subscribe(({ source: A, itemStack: B }) => {
if (equipmentRegex.test(B.typeId)) {
A.runCommand("tp @e[type=item,r=24] @s")
}
});
would be cool if there was an OnIgnite event for blocks.
Wdyn?
You want to detect fire tick is all?
detect if a block has been caught on fire
thats a very interesting syntax
gotcha, i have to try this
You can probably shorted it by js adding or statements. Like
.includes("_axe") || .includes("_hoe") etc
cut it in half
oh that works too
loll
and its shorter
awesome
nice tho
or obviously an array like
array = [ "_axe", "_hoe", etc ]
then check if it has anything in that areay
i have done this tho, but in System.runInterval
but it kind of....
a few diff ways to minimize it
kind of?
Also, how long have you been scripting? I just got back into it an I'm SUPER rusty
if(C1.typeId.includes(":")||C2.typeId.includes(":"))
well, still a beginner tho
yeahh
ohh I see
yes, i wanted it works if i using a piece of thing but only 1, but ended up the code only detects the first C1
ah, I see
what project are u working on rn?
ohh I see
ofc
If you'd like, I'd love to work with you on it. I need something to do to keep me motivated 😭
ive hit my creative/motivation block for scripting
🗣️ 🔥
but actually, i don't working too much
i just open my laptop and think a lot
then write it
then....
re-write it again
🗣️ 🔥
Yep
then never finish
I got trouble keeping consistent when I'm not writing for anyone but myself lol
yes, but it kinda fun and frustating at the same time
from @minecraft/server 1.19.0 to 2.1.0, there's some changes
like how runCommandAsync doesn't work somehow
yes lots
so i have to change it to runCommand
and applyKnockback (my favorite)
🗣️ 🔥 Apply 100%
it happened to RLCraft bedrock, which every mob that deals knockback is buffed
they got the same knockback range, but gladly they fixed it
that's why i'm still do scripting for my RLCraft experience
can someone tell why does beforeEvents is not working?
system.beforeEvents.startup.subscribe((e) => {
console.warn("startup")
});
no errors or whatsoever
yesss
yeah
I use it for things like uhh
can I dm you a quick vid
in a sec
I still have no idea what RLCraft is 😭
idrk how to explain it
like a diff and better teleport
and dashes ofc
is there a way to detect TPS using scripts?
I'm sure there's a roundabout way. I couldn't tell you though 😭
wait i found one
i pinged u
let checkTime = Date.now();
let currentTicks = 0;
let TPS = 0;
system.runInterval(() => {
currentTicks++;
const currentTime = Date.now();
if(currentTime - checkTime > 970){
TPS = currentTicks;
checkTime = currentTime;
currentTicks = 0;
}
},1);
Try
It's in a forum post
ooo thanks :)
yess. what r u looking for tps for?
I am running a lot of runIntervals
so trying to shotern those down, and also use less of them
just optimizing stuff
got it working
ohhh
ofc
awesomeee
Do we know what beta version is releasing tomorrow? I'm using 2.2.0-beta right now
A beta is releasing tomorrow? 😭
What will be added?
Then 2.3.0
Sorry, better question, is it confirmed that it's actually updating, like, 2.3.0 would be next, but idk if drops actually always come with a new version
versioning latest beta module with "beta" is this update or still in preview?
Yes.
AH thanks yeah perfect
preview iirc
Guys, I'm trying to create a script code that is always saved even if players leave the world or server or the server restarts as well, how do I do this?
what are you saving?
stetando saves tags, and the UI shows statistics, for example, I have tga1, the UI appears for the player when using an item and serves the player with tag2
uhhhhhh
I've been trying to do this for a long time, it would be a clan code
like I wrote !clan after 3 seconds I opened a UI, depending on the tag I opened a specific UI, like there are 3 clan leader members: (clan name) au I'm trying to save them on the server
can you help me?
???
use dynamic properties
ok, I'll try
should i truncate the numbers to save space
this is stored in a dynamic property as a string
you could probably get away with trimming it a little, as long as you dont see a noticeable difference it should be fine
yeah i don't think i need 17 significant figures for camera position 😭
trimming it to 7 should be fine considering that bedrock edition only stores positions to about this precision anyways
looks like it works with this code
thank you sir
does anyone need help with script?
if you want to help, just help
huh
if anyone need to learn javascript you watch https://youtu.be/0Kbd3ZH50xU?si=MP4RDNtk0gEWnJwR
Are you ready to master JavaScript and become a confident web developer?
In this complete course, I’ll take you on a journey from zero to hero, covering everything you need to know about JavaScript — from the basics to advanced concepts.
📚 What You’ll Learn:
✅ JavaScript fundamentals (variables, data types, operators)
✅ Functions, ...
what is this bro
..
man! you gotta learn to write properly, its darn annoying.
what even is pageX and pageY
do entities have a unique id that we can get? or should I make a system with dynamic properties?
is that unique? I searched the chat and its mixed on if its same as type id or not
ima just check
In general yeah
it is, some guys reported that it change some times, but i have never had that
it only changes when you change world. I heard somewhere they also change if you switch server
That kinda obvious, the entity is not the same anymore, i am talking about same world
same world if you change server
let me test it real quick, it doesn't make sense in my head
it maybe also is just the player id
so far I have yet to find an issue with it but I do remember seeing people claiming that the id changes
Maybe it was a bug or that it changes with worlds (for players)
I can't remember how I fixed it before or if I even fixed it, but is there a solution to this?
I think last time I ran into it I said screw it and just multipled all my base values by 10 and rescaled everything
use the toFixed method
or round
so if you just want 2.4 do
num.toFixed(2)
didn't know about this. thanks!
yeah it’s extremely useful
you just lost 5 levels, you are back to Level 5 Scriptoholic
import * as server from "@minecraft/server"
import * as v3 from "./v3.js"
import * as f from "./functions.js"
const world = server.world
const system = server.system
system.beforeEvents.startup.subscribe((init)=>{
let resetWorldCommand= new server.CustomCommand
resetWorldCommand = {
description: `Reset the map`,
permissionLevel: 0,
cheatsRequired: true,
name: `rareloot_mm:reset_world`
}
init.CustomCommandRegistry.registerCommand(resetWorldCommand)
})```
i'm trying to reguster a custom command, but it isnt working
is this line in specific what's giving me problems
let resetWorldCommand= new server.CustomCommand```
any idea what i am doing wronf?
Does anyone know the 2.3.0-beta patch notes?
Changelogs in here: https://discord.com/channels/523663022053392405/1422602059198238822
I'm not versed in javascript, I'm versed in minecraft scripting
you need to know js for mc
I only know what I need to know at the time I need to know it
fair enough
do you know all of the array methods n shit?
like .find, .filter and .some?
found out about all of those like 5 or 6 months ago when chatGPT randomly used them and my mind exploded
Thanks!
Random issue popped up on BDS after update, damaging any entity as the player doesn't work. It's probably one of the addons ofc, but they aren't all mine. There's about 15, any ideas what could be breaking it? The entityHitEntity event fires but nothing happens visually, not even the sound queue for hitting someone who can't take damage
fyi, this happens when doing math with floating points (0.1 + 0.2 != 0.3 for example).
Almost every language does that.
Punching any mob crashes the server with this error
This also happens in low level languages. However, you have the option to change the type of the variable to something that might handle it
The problem exists in the first place cuz we have a hard time representing fractions in binary
was scripting touched in todays minecraft update?
Yes.
what did they change
Read the changelogs.
send a link to it
#1067535608660107284 message
looks like nothing of note was changed just features moved out of beta
I also believe this happens when returning from some API calls because JavaScript and Minecraft hold two different precisions of floats. For example, reading the value of a movement attribute (it is stored as 0.1 on the player, but it might return some 0.100000000002)
In any case, toFixed works, but you can also try using Math.fround to find the nearest 32-bit precision float of a number. That should catch some of those cases
The fix was... nothing. Restarted like 5 times, then it just didn't crash anymore. Bedrock... yep
store the bytes of the number instead
each float will be about 4 bytes only
is it possible to cancel death messages?
actually insane idea
wait does JavaScript provide a way to serialise objects into bytes
so no python pickle ahh thing
so yeah you can abstract it
?
pickle is python's module for serialising objects
the only problem are null bytes which are 0 and treated as end of string
oh I shouldn't have those
but you can avoid so by using something like Base32767
wait even in floats???
floats are more bytes
so yeah
you can
you can save any type of data you want
im really thinking in writing something for this, to avoid the usage of json on dynamic properties
But but i dont wanna relearn JavaScript
:(
please support this is my youtube channel
whats up with the big text
my text is defaulted to this because im on andriod
no it isnt
it is
it isnt
not all andriods are the same
idk what android you even have but ok
please support my youtube channel
that isnt even your channel
why do you say this?
there is a Potion.resolve in the new update, what is that? can we create custom potion effects or its for get a vanilla potion?
From the looks of it, you can create custom potions but just with existing vanilla effects, still no support for custom effects.
oh, alright, thx
very defaulted...
hey guys, was entity scale component value always read only?
iirc, we could set it back in the days.
iirc it became read only at some point

i forgir tho
what does it even set? why does the description say that lol?
sets the entity's visual size.
makes sense
Peak trolling
In any event is is really obnoxious and I'd ask staff to discourage this behavior
i am helper here if any one need help @
@magic peak Quit it dude. One more time I see those big messages or you keep being annoying thats a 1 day mute.
world.afterEvents.entityHitEntity.subscribe((event) => {
const hurt = event.hitEntity;
const hit = event.damagingEntity;
const velocity = hit.getVelocity();
if (hurt.hasTag("hurt3") && hit.isOnGround) {
const hitView = hit.getViewDirection();
const impulseStrength = 3;
const impulseStrengthy = 7;
const finalImpulseVector = {
x: hitView.x * impulseStrength,
z: hitView.z * impulseStrength,
};
hurt.applyKnockback(finalImpulseVector, 0);
hurt.playAnimation('animation.hurt4');
hit.playAnimation('animation.susie_attack3');
}
if (hurt.hasTag("hurt3") && hit.isFalling) {
const hitView = hit.getViewDirection();
const impulseStrength = { x: 0, z: 0 };
const impulseStrengthy = 7;
const finalImpulseVector = {
x: hitView.x * impulseStrength,
z: hitView.z * impulseStrength,
};
hurt.applyKnockback(impulseStrength, -1);
hurt.playAnimation('animation.hurt4');
hit.playAnimation('animation.downslam');
}
if (hurt.hasTag("hurt3") && !hit.isOnGround && velocity.y > 0) {
const hitView = hit.getViewDirection();
const impulseStrength = { x: 0, z: 0 };
const impulseStrengthy = 7;
const finalImpulseVector = { x: 0, y: 4, z: 0 };
hurt.applyKnockback(impulseStrength, 0.5);
hurt.playAnimation('animation.hurt4');
hit.playAnimation('animation.uppercut');
}
}); ```
How do I make it identify the item in the player's hand?
if some needs help, this one will ask, you dont need to act like this
i don’t understand why you are getting mad when i’m trying to help
@magic peak can you help the guy above
nvm
Because it's annoying.
import { world } from '@minecraft/server';
world.afterEvents.entityHitEntity.subscribe((event) => {
const { hitEntity: hurt, damagingEntity: hit } = event
if (!hurt.hasTag("hurt3")) return;
const item = hit.getComponent("equippable").getEquipment("Mainhand")
if(item) {
//...
}
const velocity = hit.getVelocity();
const hitView = hit.getViewDirection();
// using a function so we don't repeat part of the code in *1 *2 and *3
const handleHit = (animHurt, animHit, kb, kbY = 0) => {
hurt.applyKnockback(kb, kbY);
hurt.playAnimation(animHurt);
hit.playAnimation(animHit);
};
// passing diffrent data to the function depending on the condition
if (hit.isOnGround) {
// *1
handleHit("animation.hurt4", "animation.susie_attack3", { x: hitView.x * 3, z: hitView.z * 3 });
}
else if (hit.isFalling) {
// *2
handleHit("animation.hurt4", "animation.downslam", { x: 0, z: 0 }, -1);
}
else if (velocity.y > 0) {
// *3
handleHit("animation.hurt4", "animation.uppercut", { x: 0, z: 0 }, 0.5);
}
});
Trying to help people is annoying?
Constantly using big text and asking who needs help is annoying yes.
if someone need help you will find him asking here or in a post
Uh
Thanks
I'm starting out in this scripting area
soo readable
now we can make rpg system?
do you want help?
bros trolling, only answer i can think of for this
After changing my manifest to 2.3.0-beta, it just doesn't update in Minecraft? It's in the development folder and I normally have no issues. Restarted Minecraft and nothing, it's absolutely the right addon. This is starting to get much more common, ideas?
If I remove the pack from my development folder then it notices and hits an error, put it pack, same 2.2.0 error. Notepad confirms it's not VS Code
Changed the UUID and pack name, shows in game, still thinks I'm requesting 2.2.0-beta
I can even update this label right above, and it shows
