#Script API General
1 messages · Page 71 of 1
This is also not working
const overworld = world.getDimension("minecraft:overworld");
i think it has to be inside a worldLoadAfterEvent
it's all a weird thing that I'm still getting used to tbh
Hey I am trying to run some logic on a delay, after world initialization. But ive had instances of players loading at different times, so the logic isnt always triggering.
just using this 120 tick condition. I know i could also use system.runTimeout?
I was hoping for something like onPlayerFullyLoaded
PlayerSpawn.
👍❤️
No luck with this. OnPlayerSpawn works. but it seems to be working differently for particles
Any ideas?
uhh, how am i going to use scoreboards to make my 2 separate addons work together?
my main thirst addon should detect the player scoreboard, that scoreboard will not be available until u activate both addons.
like the second addon will add the scoreboards,
hmm, lemme think about it a little bit
meh doesn't worth it.
if (!event.initialSpawn) return
oof
how does it work that the parameter for the shoot() method decides both speed and direction of the projectile?
I'm trying to make an entity shoot a projectile towards it's target using scripts
and using their view direction doesn't work very nice, it just never hits the player
anyone has any clues on how to make this work?
a velocity vector is basically just how much speed in each direction
try multiplying the view direction by the power you want to shoot with
anyone know if there's a way to delay the time before an itemStack can be picked up? if you summon an itemStack currently you can just instantly pick it up
how can i get the name of the entity with provided typeId? and also can it be used in custom mobs?
you mean it's translation key?
yeah i guess
like for example
minecraft:cow returns Cow, while custom:mob returns Mob Name
just did split string but i dont think its an accurate mobname when it goes with custom mobs
yes it is possible
on preview
last preview added .localizationKey property
so that return its name?
i don't think so, ig it it has the localization key, you have to use rawtext translate to get the name
smart, cool! thanks!
like
cow = ...
world.sendMessage({ rawtext: [ { translate: `cow.localizationKey` } ] });
supposing cow is not undefined and is a valid entity
Is that a thing
Is it possible for me to use an item on a cake with a candle and instead of him eating the cake he lights the candle?
yep, latest preview
I guess
yes, it is possible to change this, the problem is that the action of eating happens, so I wanted to know if it is possible to kind of cancel it
Just cancel the block interaction
is there any way to get the weather?
With playerinteractwithblock?
Yea
I think so, because an example of a trident here on the server uses this for one of the enchantments
There is an event for it i believe
You need to store it somewhere
ok
dimension.getWeather()
it's in beta btw
very cool
when I finish I'll show ya
Enchantments have a component, is it possible to add them to items without adding the enchantment directly?
actually I was wrong, I meant component not behavior
same thing, u need the component to add enchantmets to an item
unless if you
- re-code the enchantment
- use an nbt editor
oh yes, it's because looking at the files, the cart with tnt collects the fire aspect component, if it were possible to add this it would help me with my item
But, thanks
try to use the entityHurt event to get the item and the cart. Then fire the event that make the cart ignite
how to contribute scriptapi devepment?
It's closed source. But if you want to see it improve:
- Engage with the community, and encourage good coding practice and good behavior. Be humble, ethical, and educated, and always be ready to learn and teach.
- Make and discuss suggestions. The API devs are in various communities, and on occasion they might poke their heads in and take inspiration from the userbase.
- Fill out surveys. These go out every so often, and they are a great way to give feedback directly to Mojang.
properties in an entity’s behavior file are connected to a dynamic property in a script correct?
No.
i have a fake health system in a script that uses dynamic properties and i want to reassign the value of that property with the bp property in events
@wary edge ?
You can use the Entity methods of setProperty & getProperty for the BP defined ones, and the Entity methods of setDynamicProperty & getDynamicProperty for the script defined ones
okok
all need handle priviallage now😑
may i have visual aid
I don’t really know how to visually show that
Dynamic properties are exclusive to scripts
Entity properties can be accessed in behaviours, scripts and resources
i know this i just wanna know if they’re connected. im guessing not
They are 100% not connected to each other
you wouldn't even need the dynamic properties, custom properties are persistent
Was persistence ever a problem?
hello Im new to scripting, does world.beforeEvents.entityHurt.subscribe exist? if not, what are alternatives
I want to cancel player attack on certain condition
no. and there in none
in script api at least
they can store entities, yes
same, it is just like Map but with garbage collection
aye ty for the answer
eh im using it for tracking entities only so
alr
fuck
WELP
...should i just use entity's id instead?
actually, let me use Set for this...
try
for (const [key, data] of weakMap)
Goaded
yeah thats what i did
i guess that because weak map don't have these functions
.size, .keys(), .values(), .entries()
yep
alright
wait a minute
i can just ditch dynamic properties and use regular old properties instead because they exist in script AND bp
How can you prevent a player from breaking a block on the territory, but the block that he himself placed could be broken?
I'm trying to make an addon which makes items which have "reinforced" in their lore have a 10% to not lose durability when used to attack or mine. Is this possible in ScriptAPI? How can I do it?
Try storing all positions of placed blocks in dynamic properties, then check if the block is there
Not the best solution, but ehh we have no other way to check which player placed the block
what happend to applyknockback
Player.applyKnockback({ x: 0, z: 0 }, vertical)
where the force thing?
Multiply that to the x and z direction
Fromjs Player.applyKnockback(x, z, horizontalStrength, verticalStrength)intojs Player.applyKnockback({ x: x * horizontalStrength, z: z * horizontalStrength }, verticalStrength)
ok wait
let overworld;
world.afterEvents.worldLoad.subscribe(() => {
overworld = world.getDimension("minecraft:overworld");
})
Can Player.applyKnockback work on entities?
i cant seem to make it work
i tried a lot can u fix it i 'll give the code
im not good at regex, how would I go about only getting text between double quotes
if its always in qoutes then i can do
maybe this will work
YOURVARIABLE.match(/["'](.*?)["']/g).map(m => m.slice(1, -1));
Okays
i sloved it
how would i cancel blocks dropping after block is broken?
listen for block break event then kill the item that's been dropped
cancel the block drop and remove the block using setType
try applyImpulse if that doesnt work
I tried that but block still drops
That's what I was actually thinking of doing next
Like a entity.kill()
Thanks. I'm trying to give mobs the ability to dash when using a specific weapon, I'll try that too
-# other than tp, which does not seem to work half of the time
huh
that will remove the particles and sound of the block tho
yeah
preview today right?
yeah
i hope theres some good stuffs
also just a question, does instanceof Player not count for SimulatedPlayer if theres no gametest module?
never used gametest
rip
Yes!!!@shy leaf
Yes,nSimulatedPlayer extends Player
was that an answer to the
Missclicked and mentioned you instead of replying
anyone know when custom components v2 are going to be released for stable?
It's not even released in preview yet.
Alright I'll try
We don't know. All we know is soon™️
entity.remove()
that sounds like a #1067869374410657962 question
though yeah, i do know how to
but its json ui so its also painful to do one
yeah give me a second
i made a resource pack that changes tooltip anims a few months ago
let me get the vanilla ui first, i forgot the default values
this should be better for knowing the anims
nice
I figured out how to make a similar effect using the testforblocks functionality, but I don't know how to get the result of its execution in a script or how to reproduce its system, and also I realized that there are some limitations, so I'll think about how to implement it
- runInterval expects a callback
- world.getPlayers(), you don't need dimension there
- you call a function like this
ammoUpdate(), you didn't put the brackets
system.runInterval(() => {
ammoUpdate()
}, 2);
function ammoUpdate() {
const players = world.getPlayers();
players.forEach(player => {
let ammo = primaryammo.getScore(player);
let maxammo = primarymaxammo.getScore(player);
let helditem = player.getComponent('equippable').getEquipmentSlot('Mainhand').getItem();
if (helditem) {
let itemName = helditem.nameTag;
system.run(() => {
helditem.nameTag = `§r${itemName} §7(${ammo}/${maxammo})`;
});
}
});
}
try this
does it show any error in game console
you already do get the actual item
you just gotta do that
since youre getting a new copy of the ItemStack from getItem()
setEquipment*
yeah, same thing but he is using the equipment component
player.runCommandAsync("execute as @s[tag=slot2] run scoreboard players set @s slot2 1");
runCommandAsync got removed
what's the other one?
runCommand()
Thanks
that doesnt work with beforeEvent playerBreakBlock
ofc it does??!
world.beforeEvents.playerBreakBlock.subscribe(({player, block, itemStack, cancel}) => {
const inventory = player.getComponent("inventory").container
if(block.typeId === "minecraft:coal_ore"){
cancel = true
system.run(() =>{
block.setType("minecraft:air");
const coal = new ItemStack("minecraft:coal_ore", 1)
const coalPrice = items.get("minecraft:coal_ore")
coal.nameTag = `§a$${coalPrice}`
inventory.addItem(coal)
})
}
})
i cant define entity in this event
getEntities() then get "minecrafft:item"
hello to my script api docs users, do y'all want this search layout or prefer the current one?
like this?
world.getDimension("overworld").getEntities("minecraft:item")
looks good
world.getDimension("overworld").getEntities({types: ["minecraft:item"]})
that one looks better, maybe change up the icons to the old ones tho
oh those icons are for documents (yes you can add markdown articles in typedoc), icons stay the same
maybe type: [] is not the right syntax
remove []
idk why it doesnt get killed
current one is better
send code
just the part where you kill it
how can i make the user cant throw an item?
nbt itemlock
/give @p iron_axe 1 100 {"minecraft:item_lock":{ "mode": "lock_in_inventory" }}
I'm getting error in this
}).catch()
Without any further context, one can only assume you are missing opening brackets
ItemStack.lockMode = 'inventory';
How
You have an open } brace and an open ) brace
More context of your code would be nice
Showing ten characters and saying there's an error is extremely unhelpful
are we able to get anything about what smithing templates were used on equipment via itemStacks? I'm not seeing anything
No.
hey so uh it keeps saying that the player doesn’t have properties even though it does
in my content logs
are there any requirements i need to meet or something
Give the exact code and error.
do you want me to dm you or spill the beans here
Just send it here.
import { world, system, Player, Dimension } from '@minecraft/server';
const player = world.getPlayers()[0]; // player
const players = world.getAllPlayers()
const entity = world.getDimension('overworld').getEntities()
const scoreboard = world.scoreboard; // scoreboard
world.afterEvents.projectileHitEntity.subscribe((e) => {
const projectile = e.projectile;
const target = e.getEntityHit()?.entity;
const instigator = e.source;
const entity = world.getDimension('overworld').getEntities()
let targetHp = target.getProperty('fakehp');
if (targetHp === undefined) {
world.getDimension('overworld').getEntities().forEach((entity) => {
entity.setProperty("fakehp", 100);
});
}
const playerScore = score.getScore(instigator);
let damage = 0;
if (projectile?.typeId === 'ata:buckshot') {
damage = 100;
} else if (projectile?.typeId === 'minecraft:snowball') {
damage = 20;
} else if (projectile?.typeId === 'ata:pissbullet') {
damage = 25
}
if (team !== 2) {
world.sendMessage("Friendly fire detected!");
return;
}
if (targetHp <= 0) {
world.sendMessage("No health detected for the target.");
return;
}
if (targetHp > damage) {
target.setProperty('fakehp', targetHp - damage); // Apply damage to target
instigator.onScreenDisplay.setTitle("§r+", {
stayDuration: 3,
fadeInDuration: 0.1,
fadeOutDuration: 0.5
});
} else if (targetHp <= damage) {
target.setProperty('fakehp', 0); // Set target health to 0 (dead)
instigator.onScreenDisplay.setTitle("§c-X-§r", {
stayDuration: 3,
fadeInDuration: 0.1,
fadeOutDuration: 0.5,
subtitle: "+1"
});
world.sendMessage(`${instigator.name} killed ${target.name}.`);
}
});
Also I ran testfor @e[has_property={ata:fakehp=true}] into a repeating command block and it didn’t return anything so that might be something too
i mean yeah cuz the player.json has properties but the game says otherwise
it says it doesn’t have any properties
Are you sure that the player.json is a valid json?
if the commands doesn't work, it's a sign that there's a problem in entity itself.
Neither of them is the problem.
You are the problem lol, it should include the namespace.
am i the problem
where?
you used fakehp without namespace
damn
let me see if what i do will fix it
maybe i am stupid
@dim tusk even with that fixed i don’t think the properties in the json wants to cooperate
Doesn anyone know how to visualize profilerfiles in realtime when testing code?
what if you do it in scripts?
tried doing that and it returned undefined
im starting to think the player.JSON just doesn’t support actor properties or something
i’ve tried initializing ata:fakehp with setProperty and using behavior events
They do...
i’ve tried doing scoreboards for fake health in the scripts but sometimes they don’t sync up in the actual game and q.scoreboard can’t be used for rp so if this doesn’t work im just gonna use regular vanilla hp
I tried mine and it works fine.
scoreboards or actor properties?
properties.
ok, when you do the command in chat not command block does it show the properties or nah
it says no targets matches selector
guessing it’s because it thinks the player doesn’t have those properties
noo, that's not what I meant, if you the command in chat it shows the available properties
/testfor @a[has_property={
If you do this it shows them.
of course, why else would it say there weren’t any targets matching it
the properties exist in the game but not for the plauer for some reason
How to get the render distance of the player(not max render distance)?
pretty sure you cant
lockCamera() {
const cameraLocation = {
x: this.player.location.x,
y: this.player.location.y + 1.6,
z: this.player.location.z
};
console.log("Setting camera at: x=" + cameraLocation.x + ", y=" + cameraLocation.y + ", z=" + cameraLocation.z);
console.log("Facing NPC ID:", this.npc.id);
try {
this.player.camera.setCamera("minecraft:free", {
facingEntity: this.npc,
location: cameraLocation,
easeOptions: {
easeTime: 0.5,
easeType: "linear"
}
});
console.log("Camera set successfully (no fov)");
} catch (error) {
console.error("Camera set failed:", error);
}
}```
So I dont really understand, im trying to make the camera pan over and lock on to the NPC
but for some reason it just goes to 0 0 0 (or somewhere far under the map)
The correct coordinates are being passed, but the camera never actually goes to the camera location
So the errors I have are the keys {}
i'm trying to make the damage reduction for my custom armor horse using script but the damage not get reduce. Can someone help pls
sadly you can't cancel damage taken using scripts
can anyone help me with this
since the new update has dropped
they changed the parameters for applyKnockback
and now idk how to apply verticalStrength.
import {
Entity,
world,
system,
} from "@minecraft/server";
system.afterEvents.scriptEventReceive.subscribe(({ sourceEntity, id }) => {
const view = sourceEntity.getViewDirection();
const target = sourceEntity?.target;
console.error(id);
switch (id) {
case 'cod:event_knockback':
if (target) sourceEntity.applyKnockback({ x: view.x * 8.5, z: view.z * 8.5 }, 0.1);
break;
case 'cod:event_charge':
if (target) sourceEntity.applyKnockback({ x: view.x * 10.5, z: view.z * 10.5 }, 0.1);
break;
default: break;
}
});```
the mob that uses it jumps like this atm
ur already applying vertical strength
the 0.1 is the vertical strength
ah alr
is there any way to do that
There's no way to do it in scripts , you can cancel damage in the entity JSON , there is a damage_sensor component
but don't worry, me and @unique acorn are make a entity hurt before event 😎 so you can cancel damage
any example using this module?
idk how to use it
Is that actually possible? Cuz if it is, that would be amazing!
How can I ensure that my block ticks randomly more often?
this is a general JavaScript question, i want to use an expression as a condition for an if statement, similar to this: ```js
if ({
const n = true
return n
}) {
...
}
This syntax is obviously wrong, how can i make it work?
if(const n = true) should work.
my actual expression is kinda more complex than that, i want to check if a container exists in a location and if it does check if it has items
no
use a callback
() => {
const n = true;
return n;
})()
i have the expression but I can't be brothered to copy it all to my mobile
if((() => {
const n = true;
return n;
})())
i tried that it returns a function
wdym
i feel like doing this would be easier
const n = true;
if (n) {
}
oh, wait i had to move the () outside the other ()
i had it like this
(()=>{}())
it needed to be like this
(()=>{})()
Yeah it is.
let n = 2;
if(n=1) console.log(10);
Works as well.
why do you need it that way btw
Or ideally a function if it's complicated.
function containerExists(location) {
// ...
}
if (containerExists(location)) {
// ...
}
i have an achievement system and i am adding completion queries to it in the form of an object {id: 'comdition'}
the condition is a string that gets eval() into true or false
sound like you are complicating it a bit, also eval() can and should be avoided
const queries= {
cobblestone: `player.runCommand(testfor @s[hasitem = {item:cobblestone}]).successCount`
}
for (let query of Object.keys(queries)) {
if eval(queries[query]) complete(query)
}```
i can't think of a better way to store a lot of conditions
const queries= {
cobblestone: () => player.runCommand("testfor @s[hasitem = {item:cobblestone}]").successCount
}
just make a parser
not sure how well this will go, the expression and the functions they use are in separate files
you could give the functions any context they need using arguments
const queries= {
cobblestone: ({ player }) => player.runCommand("testfor @s[hasitem = {item:cobblestone}]").successCount
}
i will try that
i think i am too deep to change everything now...
i got over 60 achievements written
it works, i guess i have replace them all now
use native functions instead of commands!
one testfor command VS 36 iteration of getItem
wait can i register commands like this?
/help:e
/spawn:e
/lobby:e
in preview, yes
i really dislike the namespace requirement
it's still in preview tho so stuff could be changed 
✅
another week of waiting for preview ahh moment
??
nice
system.runInterval(() => {
for (const entity of overworld.getEntities({ type: 'minecraft:zombie' })) {
const velocity = entity.getVelocity();
if (velocity.x === 0 && velocity.y === 0 && velocity.z === 0) continue;
const loc = entity.location;
const min = { x: Math.floor(loc.x) - 2, y: Math.floor(loc.y) - 2, z: Math.floor(loc.z) - 2 };
const max = { x: Math.floor(loc.x) + 2, y: Math.floor(loc.y) + 2, z: Math.floor(loc.z) + 2 };
const blocks = Array.from(overworld.getBlocks(new BlockVolume(min, max), {}).getBlockLocationIterator());
for (let i = 0, limit = Math.min(4, blocks.length); i < limit; i++) {
overworld.setBlockType(blocks.splice(Math.floor(Math.random() * blocks.length), 1)[0], 'minecraft:oak_log');
}
}
}, 1);
Why doesn't this work? My entity doesn't stop replacing blocks after it has already replaced 4 blocks
post content logs
Nothing
Also,
console.error(JSON.stringify(blocks.splice(Math.floor(Math.random() * blocks.length), 1)[0]));
this returns xyz coordinates for some odd reason
what about running it for only once instead of using interval?
you could check which part went wrong that way
Wait, if I call it once, it actually places 4 blocks only
try running it another after one and see if it replaces or not
But I removed the velocity detection to test cause I am not gonna get the perfect timing on when a zombie moves
Ok, I set the interval to 50 instead of like 1 and it works now. I think I should make the interval the amount of time he takes to move 1 block
interval is still working, so in the next tick blocks will be placed as well
loop is stopping, but it's mounted in the next tick
hmm
can someone help
with some complex
So
i want to place 1 each block inside of each chunks
suppose i set A BlockVolume
from a location and to another locaitons
It will calculate the whole chunks between those two locations
And then place 1 block in those each chunks
@distant tulip
nothing complex about that
floor(coordination/16)*16 and here is your chunk origin
add 8 to that
it would get whole chunk of two locations first (also those chunks between the location), then get the middle of each
^
i need to put towo locations there
2 coords
so it get "each " chunks
between them
there is to put 1 coords, it just get the whole chunk,
what about the all chunks in middle between two coord
hmm lemme use my brain 1 sec
async function getBlockAtChunkCenters(volume) {
const { from, to } = volume;
const xMin = Math.min(from.x, to.x);
const xMax = Math.max(from.x, to.x);
const yMin = Math.min(from.y, to.y);
const yMax = Math.max(from.y, to.y);
const zMin = Math.min(from.z, to.z);
const zMax = Math.max(from.z, to.z);
for (let x = xMin; x <= xMax; x += 16) {
for (let y = yMin; y <= yMax; y += 16) {
for (let z = zMin; z <= zMax; z += 16) {
const centerX = Math.floor(x / 16) * 16 + 8;
const centerY = Math.floor(y / 16) * 16 + 8;
const centerZ = Math.floor(z / 16) * 16 + 8;
const blockLocation = { x: centerX, y: centerY, z: centerZ };
// get block at middle of each chunk
await getBlock(blockLocation)
}
}
}
}
:)) this was chatGPt , i told him, as you said, and got this
is this right
i can't be asked to review this https://github.com/JaylyDev/ScriptAPI/pull/379
huh
@distant tulip
seem so
it crashes my world
i tested
nah dont work
It still returns the "Unloaded chunk " error
you see that
await getBlock(blockLocation)
In the getBlock function
I am adding a tickarea
So the chunk loads
export async function getBlock(location, dim = world.getDimension("overworld")) {
let block, { x, y, z } = location;
const getBlock = dim.getBlock.bind(dim, location);
try { if (!(block = getBlock())) throw null; else return block }
catch {
system.run(() => {
dim.runCommand(`tickingarea add circle ${~~x} ${~~y} ${~~z} 0 "${x},${y},${z}"`);
let remove = () => dim.runCommand(`tickingarea remove "${x},${y},${z}"`);
return new Promise(async resolve => {
system.runJob(function* () {
let trials = 1e3;
do {
block = getBlock();
if (!--trials) yield void remove();
} while (!block);
remove();
return resolve(block);
}())
})
})
}
};
but still not work
unloaded chunk
idk why
minato pls help
tickingarea only loads upon player goes there once
there is a preload parameter
type the command in game and see
just add true to the end of the command
what is VanillaEntityIdentifier
wow someone is using getBlock
njmjhiojh
@distant tulip dude i'm tired, im trying to make a worldEdit
my game just keeps crashing the scripts hangs, when i try to fill alot of blocks 😭
can you please just take the whole script
i saw did some one fill large areas, he was doing it each chunk after a delay, so it wouldn't crash the gamegame
what function is causing it
Don't know
what are you doing to cause it
Is there a way to detect if an entity is riding something, and if they're not riding something, they'll get removed?
select large area and do command !set stone
first break block then go far away and right click to select another position
then to fillBlocks do !set {blockId}
How would I cancel players from taking items out of a item frame?
i tried beforeEvents playerBreakBlock, doesnt work well. Asking to see if there is any other ways
Is there a way to get the translated name of the item? ItemStack.nameTag just returns undefined when it haven't been edited yet
there's ItemStack.localizationKey in beta
you could then use something like this to display the name
player.sendMessage({ translate: itemStack.localizationKey })
ah but i need the result as itself
why
I don't think that's possible
without manually including the name of every item in your scripts
Successfully fixed dimension title (I used the Fast Loading Screen texture pack so I got an error when going through the portal, I encourage everyone not to use this texture pack to avoid errors when going through the dimensional portal (Building Terrain Interface, etc...)
||
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. ~ Brian Kernigha
||
what js version is Minecraft using I want to use Temporal
quick js
this is why I write garbage code so I can debug it 🗣️🗣️🗣️
"The complexity of code should mirror the complexity of the problem it addresses—write no more than what is necessary." ~ Jardeson Oxman
I thought that was an image, I was waiting for it to load lol
I thought that was a spoiled text, I clicked it then realized it's an image lol
you didn't have to do that tho smh
lol
if else if else if else if else if else if
i dont find the random tp script in script resources can someone # it for me
nvm
i found it
Do you know what argument the eventData.sender was changed to?
it's still the same as far as i know
ok but the thing is that my commands don't want to activate
I find it weird
any errors? show code
You need to wrap it with system.run.
why don't you use sendMessage?
the eventData.sender? I remove the runCommand?
you have to wrap the runCommand
wrap the runCommand method
I think it works well, so I don't know what difference it makes. Does it change anything?
well its not going to work at all if you dont this
oh
im dumb
native methods perform better than commands.
system.run(() => { code... })
also you are using system.run like its supposed be for sending messages
i think you are confused
Smokeystack was telling you to wrap the method in system.run and titi was suggesting to use the sendMessage method instead of the command method.
.
To explain what's happening: The event you have subscribed to (in order to send this rawtext to a player) is executing in a read-only context. This applies to any before-event. In it, you cannot change the state of the Minecraft world, as whatever the event is listening to has not happened yet.
People suggest "wrapping" the runCommand method in a system.run call to defer its execution until later in the tick, to where the world state can be modified.
It's like invoking any other function:
import {world, system} from "@minecraft/server";
function sayHiToEveryone() {
for (const player of world.getAllPlayers()) {
player.isValid && player.sendMessage("Hi!");
}
}
// System.run call, given the sayHiToEveryone function as a callback
system.run(sayHiToEveryone);
Although the pattern suggested was system.run(() => { code ...});, since folks here like unnamed arrow functions.
I am starting to hate making my Frame Blocks
what's the player.isValid && player.sendMessage("Hi!"); part? ik what they're for but isn't the && supposed to be inside an if statement?
we believe in arrow functions supremacy 🙏
These two are mechanically similar. Just comes down to coding style.
if (condition) action;
condition && action;
In JavaScript, the && operator will only evaluate the second half of the expression if the first half is truthy
tysm i just learned something new
i didn't even know that was possible xd
You've likely already used a similar form of that with the || operator, where the second half is evaluated only if the first half is falsy (as in foo = bar || {};)
didn't remember seeing that on the js course but looks familiar
But of course, I would recommend the if statements for more complex control flow or for readability. Like if you need a block to execute code in, or to use else (ternaries technically work but IMO it is poor form)
how to check for dropped item from broken block? getItemStack sometimes returns undefined when block is not the same as dropped item (like diamond ore drops diamond). so how can i check for dropped item in that location where block is broken?
how do I make a small particle with MolangVariableMap?
you could use the beforeEvent and create an object, where the key is the block typeId and the value is the expected itemStack to drop from breaking it
I don't think there is a native method to get an instance of what the block would drop if broke currentlyh
quite good idea. thanks
How would I cancel players from taking items out of a item frame?
i tried beforeEvents playerBreakBlock, doesnt work well. Asking to see if there is any other ways
make sure to take silk touch into account if that's something accessible in the environment you're making this for
The particle you are summoning would need its size to be defined by a variable. Then you could set the size with a Molang map
gotcha, thanks
playerSpawn is deprecated, is there any current alternatives?
What? Why?
😶
Definitely a mislabel.
Seems intentional
1.18
title or hud?
I just know that must be laggy
Title, run with Script API
My Traveler's Titles Bedrock addon doesn't cause any lag on your phone, tablet or PC
how did you get the specific biome? I'm curious abt it
You use findClosestBiome right? If so it must be laggy because you're checking 87 biomes altogether
Yes I did use findClosedBiome and classes BiomeTypes to check 87 biomes and there are also titles for dimensions like Overworld, Nether and The End but my phone didn't lag
@rapid nimbus
When passing through a dimensional portal, the dimension title along with the subtitle of the biome in that dimension will be displayed.
is findClosestBiome already in 1.21.70?
I added color to the two dimensions Nether (dark red (code: §4)) and The End (blue (code: §9))
Yes, findClosedBiome supports Dimension classes in the @minecraft/server v2.0.0-beta module in the Script API so I used it to create my Traveler's Titles Bedrock Addon
?
bro có chơi sever ko
im trynna develop an addon for couple months now, and i was wondering if it was better staying on 1.18.0 or dealing with breakable stuff from 2.0.0 beta
I recommend always using stable.
Yeah, but i left scripting in 1.14.0-beta and now that i came back i dont know why my addon's scripts don't work anymore
i changed the manifest to 1.18.0
If you need beta features then use 2.0.0
Aight, but there's an error when im trying to use beta too, idk why
`[Scripting][error]-Plugin [Starlight UHC [BP] - 1.0.0] - failed to create context.
[Scripting][error]-Plugin [Starlight UHC [BP]] - version conflict for module [@minecraft/server].
[2.0.0-beta] requested by [Starlight UHC [BP] - 1.0.0],
[1.3.0] requested by [@minecraft/server-ui - 1.3.0]
[Scripting][error]-Plugin [Starlight UHC [BP]] - version conflict for module [@minecraft/server].
[2.0.0-beta] requested by [Starlight UHC [BP] - 1.0.0],
[1.2.0] requested by [@minecraft/server-ui - 1.1.0]
[Scripting][error]-Plugin [Starlight UHC [BP] - 1.0.0] - run failed, no runtime or context available.`
If you're using 2.0.0, both server and server ui need to use it.
beta?
like this?
Yeah.
i think it now worked, but maybe updates broke my scripts 😭
Yeah.
oh my god, well now ill have to re do everything
one last question
This is not how you install the Node.js right
Thats right. Though youre in the wrong directory...probably.
im having a bad time using visual studio and i dont remember how to open the right terminal
bc i click there
but opens this
or maybe i dont have node js LOL
bruh what
im a hacker, i made it work
how do i make a development pack for minecraft preview?
const overworld = world.getDimension("overworld");
const notexture = overworld.getEntities({ typeId: "space:no_texture" })[0];
const loc = notexture.location;
It says cannot read properly of undefined "location" in the line in which I am defining loc variable
Is the entity in the world in the first place?
Yes
Is that a global variable or in a runInterval? Since it doesn't make sense why would it return undefined of locations if the entity in the first place exists
runInterval
Is microsoft fucking kidding me?
lmfao
How can I spawn a particle that moves upwards?
you can either
- make the particle move upwards from the particle file itself
- increase the y axes and spawn another one
- use molangVariableMap to pass the direction to a variable in the particle file
How can I do that with the Molang Variable Map?
use
v.name.x v.name.y v.name.z in the particle direction
and use
MVM.setVector3({x,y,z})
thats the most complex tasks in whole Script API bc its not related to Script API
haha
you need to know more about particles than script api
snowstorm simplify it by a lot
here is steps i recommend for you
- Learn How to create custom particles
- Learn how to use variables in custom particles
- Use MlangVariableMap in Script API (optional)
i think its important to know the particles concepts in JSON first, but it helps for visualization
I want to use vanilla Particles
you can't do that
why? :c
bc vanila particles doesn't have variable like speed and direction
particle system in Bedrock is completely different from Java
how do you apply the variable to a specific field of the particle file?
some do iirc
In general No, but there might be some exceptions
i think some have a variables for colors
define them in JSON thats all the client has to know, on server just use the variable name in MolangVariableMap
but like i said you have to know the JSON Molang particle system
its not about Script API at that point, thats my opinion
but how do candles work?
they don't have direction or speed, its just position
afaik
but like @distant tulip said there are few that has direction variable
it is really not recommended to use scripting for such a task
alright
well you can use custom particle with vanilla texture
its not a big deal, but it requires reasource pack thats only downside i see
import { world } from "@minecraft/server";
const PrimeKey = "§\ue111";
const getSubId = (id, name = "") => name + PrimeKey + id;
export class Database extends Map {
constructor(id = Database.name) {
super();
JSON.parse(String( world.getDynamicProperty(this.id = getSubId(id, Database.name)) ?? "[]"))?.forEach(
rawKey => this.set(rawKey, world.getDynamicProperty(getSubId(PrimeKey + rawKey, this.id))))
}
clear() {
for (const rawKey of this.keys()) {
world.setDynamicProperty(getSubId(PrimeKey + rawKey, this.id), null);
}
world.setDynamicProperty(this.id, "[]");
return super.clear();
}
delete(rawKey) {
world.setDynamicProperty(getSubId(PrimeKey + rawKey, this.id));
return super.delete(rawKey);
}
propertyKeys() {
const primedKeys = [...super.keys()].map(rawKey => getSubId(PrimeKey + rawKey, this.id));
return world.getDynamicPropertyIds().filter(propKey => primedKeys.includes(propKey));
}
get(rawKey) {
return world.getDynamicProperty(getSubId(PrimeKey + rawKey, this.id))
}
set(rawKey, data) {
let primedKey = getSubId(PrimeKey + rawKey, this.id);
if (!data && !"stringbooleanumber".includes(typeof data)) {
super.delete(rawKey);
world.setDynamicProperty(this.id, JSON.stringify([...super.keys()]));
return world.setDynamicProperty(primedKey), this;
}
if (!super.has(rawKey)) {
super.set(rawKey, data);
world.setDynamicProperty(this.id, JSON.stringify([...super.keys()]));
} else super.set(rawKey, data);
world.setDynamicProperty(primedKey, data);
return this;
}
};
[Scripting][error]-ReferenceError: Native function [World::getDynamicProperty] does not have required privileges. at Database (Modules/Database.js:9)
at <anonymous> (Crate.js:38)
help me fix it
you're probably calling a method before the world has loaded or in the beforeEvent, which is read-only right now
in this case: world is not initialized yet, that's why it's throwing up an error
You have to execute your Database construction inside world.afterEvents.worldLoad
import { Database } from "./database";
var database;
function loadEntry() {
database = new Database("hi");
}
world.afterEvents.worldLoad.subscribe();
var is crazy
import * as mc from '@minecraft/server';
mc.world.beforeEvents.chatSend.subscribe(data => {
const
player = data.sender,
message = data.message;
if (player.hasTag("uchiha")) {
data.cancel = true;
world.say(`<${player.name} §cUchiha§f> ${message}`);
}
});
api 1.18.0, It's not working, what's the error?
idk you tell me the error/j
chatSend is only in beta api btw
so that's the issue
@hazy copper ask here dont be shy
world.say() is not a valid method
lol
😭
import { world } from '@minecraft/server';
world.beforeEvents.chatSend.subscribe(data => {
const player = data.sender,
const message = data.message;
if (player.hasTag("uchiha")) {
data.cancel = true;
world.sendMessage(`<${player.name} §cUchiha§f> ${message}`);
}
});
use beta api script version, in your manifest
isn't World::sendMessage throwing up an error in beforeEvents after 2.0.0-beta?
Nah, Player.sendMessage() and World.sendMessage() can be used in beforeEvents
With system.run
I know
but doesn't they throw up an error?
that's what I am talking about
It always was the case
not for 1.x.x versions
It is
calling World::sendMessage or Player.sendMessage does not throw error without any privileges in beforeEvents
for 1.x.x versions
weird
can we multithread some loops in script api?
Even without system.run, you can run it. Similiar to dynamicProperty. try it yourself
Is there a quick script for all mobs excluding those in the inanimate family to have a 1% chance of dropping a custom item when they die?
//entityDie afterEvent:
if (!deadEntity.isValid) return;
if (deadEntity.matches({ families: [ "inanimate" ] })) return;
itemDrop(deadEntity.location,deadEntity.dimension)
//itemDrop(location,dimension) function:
if (Math.random() < 0.01) {
const itemStack = new ItemStack("apple",1);
dimension.spawnItem(location);
}
//entityRemove beforeEvent:
//handle special case like projectile, armor stand, minecarts, item entity (those who has instant despawn after dying)
if (removedEntity.matches({ families: [ "inanimate" ] })) return;
const { location, dimension } = removedEntity;
system.run(()=>itemDrop(location, dimension))
Thank you !!
some functions can be called even in read-only mode
Low
Is there any way to detect what block is under the entity?
Yes.
/**
* Gets the block just below the entity.
* @param {Entity} entity - The entity.
* @return {Block | null} The block below the entity or null if unavailable.
*/
function getBlockBelow(entity) {
const loc = entity.location;
loc.y -= 1;
return entity.dimension.getBlock(loc);
}```
or if using custom compoenent, there is onStepOn
any|null is crazy work
Thanks!
is this ts or js?
js
lol
k
it is worth assuming that ts and js have the same syntax,
if there is no type definition then it is javascript. (most cases)
yeah, im new to this( i only know c++ mainly)
more like Block | null
in your main.js file do this:
import { world } from "@minecraft/server"
world.afterEvents.worldLoad.subscribe(() => {
import("./block_trigger")
})```
that file is block_trigger.js where appears to be the error right?
Or, in the function there is a lot of playSound, you can put await null; just inside the function, on top of those playSounds
function blockPlaceNoise() {
await null;
if () {
dimension.playSound
}
else if () {
dimension.playSound
}
else if () {
dimension.playSound
}
}```
i dont want to extact texts from your immage, so here is just example
that worldLoad method is better than doing await null; btw
you are using playDimension in a before event where you can only use read-only methods
playSound*, had a stroke
It worked before 😭
they added this years ago but it did work at one point
Not years ago
I already provided you fixes..
So this didn't work
this? @tidal wasp
Not working
just send the codee
Oh rename the function to async function
async function blockPlaceNoise(){
await null;
if () {
dimension.playSound
}
else if () {
dimension.playSound
}
else if () {
dimension.playSound
}
}
or just use system.run() dude
use system.run() at where you executed the function
because the playSound inside the function is only returning error
show code
this is not how it works.......
been a while but if you're wondering why this didn't work is because, again, you're using playSound in a read-only environment (beforeOnPlayerPlace)
Traveler's Titles Bedrock Addon English Languages (USA):
https://www.mediafire.com/file/p07l1lhtnnw7239/Official_Traveler%2527s_Titles_Bedrock_by_TPTGSUHuuTinVietNam0941_%2528US%2529.mcaddon/file
what
this channel isn't for promotion
I know that but I send the link to my addon package for people to download and try my addon package because I'm afraid it has some bug in my Script API so people can report errors in the script to me so I can fix them in the Script API only
You should say that for context. It would also probably be best to open the question in #1067535382285135923
Okay
How to create an event for the "/scriptevent" command?
?
"Create an event"
I mean, how to use it?
how can i stop player from using an item when the use duration reaches certain point?
i set the cooldown for item, but player keeps using it, i need to stop that
import { world, system } from "@minecraft/server";
system.afterEvents.scriptEventReceive.subscribe((event) => {
event.id //@remarks — Identifier of this ScriptEvent command message.
event.message //@remarks — Optional additional data passed in with the script event command.
event.sourceEntity //@remarks — Source entity if this command was triggered by an entity (e.g., a NPC).
event.sourceBlock //@remarks — Source block if this command was triggered via a block (e.g., a commandblock.)
event.sourceType //@remarks — Returns the type of source that fired this command.
//example use
if(event.id === "admin:anounce"){
if(!event.message) return
world.sendMessage(`📢-Announcement: ${event.message}`)
}
});
add a dp ("last used on") and cancel the event based on that and the current time
If its an custom item use cooldown component
as i said, i've added a cooldown, but, i keep holding the item, and the events keep happening
It will still happen just add an if
i have an itemStartUse after event, and a system.runInterval that increases my let ticks = 0 with ticks++ when ticks >= 20, i set the cooldown, but, i keep holding the item. events keep happening
Do not run the action if your cooldown ticks remaining are not zero or whatever you set
Ahh! Use duration. Sorry
My bad...
Returns the time, in ticks, for the remaining duration left before the charge completes its cycle.
ah, so how do i stop the action from running further, even if i have a cooldown that has started, but i'm still using the item...
if useDuration == max use duration
hold on, i'll show what i have...
world.afterEvents.itemStartUse.subscribe((event) => {
const { source, itemStack, useDuration } = event;
if (itemStack?.typeId !== "item") return;
const selectedItem = source.getComponent("minecraft:equippable");
let ticks = 0;
const hammer = system.runInterval(() => {
ticks++;
const property = source.getDynamicProperty("item");
if (ticks == 14) {
source.dimension.spawnEntity("entity", source.location).triggerEvent("event");
}
if (ticks >= 20) {
system.clearRun(property);
source.startItemCooldown("item", 200)
return;
}
}, 1);
source.setDynamicProperty("item", hammer);
});```
so when ticks is >= 20, then i need to stop item from being used, even if i'm still holding the use action
so your problem is, when the item cooldown is done, the itemStartUse trigger again?
no, when ticks is >= 20, the item should be stopped from being used any further, even if still holding the right-click button. i've tried setting the cooldown, but it doesn't work, like, visually, the cooldown appears on the item, in inventory, but the item is still is use, and every 14 ticks my entity get's spawned again...
what are you referring to by "the item being used"
Try clearRun(hammer)
already doing that
holding the right mouse button
item being in use
i honestly don't know how else i could explain it...
the itemStartUse triggering as i said?
also
if (itemStack?.typeId !== "item") return;
this is wrong, no?
no, i haven't modified the code yet, this is it's current state
no, i just can't show the item ID's
so i've tried one thing
i've cloned the item with itemStack.clone()
and then did this
selectedItem.setEquipment("Mainhand", new ItemStack("air", 1));
system.run(() => {
selectedItem.setEquipment("Mainhand", item);
})```
i am bit confused tbh
maybe try ItemUseAfterEvent
just, the issue is, if player immediately switches to another slot when the item is getting replaced, the slot player just selected gets replaced with the cloned item
afterEvents.itemUse?
yeah
a custom bow?
I wanted to know how to use the types installed globally
how to install them or how to use them?
Use
so, from what i am understanding
itemStartUse get triggered even if you didn't release the item and start using it again?
yes
they just work, no need to do anything
i don't remember it being that way
hmm?
nah, not genius...
this is a custom item, right?
yes
do we need to use minecraft:chargeable?
no
ah, that is deprecated anyway
lol
could you log the value of useDuration and see what it is when the problem happen
i've just found a solution
not perfect, but it'll do it
sorry for taking up your time😭
cool, and it is alright lol
Is there a way to detect how long an entity has been alive
Like e.g.
if ( entity.age <0.07 ) {...}```
world.afterEvents.entitySpawn.subscribe((event)=>{
event.entity.setDynamicProperty('spawnTime', Date.now())
})
Would I have to make this into a constant
So that I could then detect if it is a lower value than whatever number I need
I would not use Date.now. This does not account for the game being paused
Use system.currentTick instead
When you need to find the entity's age, compare the value of their 'spawnTime' dynamic property to whatever the current time/tick is
you should messure all time in ticks to match the game experience
i forgot about game pause
function getEntityAge(entity) {
const spawnTick = entity.getDynamicProperty('spawnTime');
return system.currentTick - spawnTick;
// const spawnTime = entity.getDynamicProperty('spawnTime');
// return Date.now() - spawnTick;
}
after thinking about it, Date.now() is really bad in this case
the time where the server is shutdown will count too
Oh haha, true
doesn't system.currentTick reset to 0 once the world is started?
nope
Thank you very much, everyone
getAbsoluteTime and currentTick whats the different
Not sure. Have you noticed any difference?
getAbsoluteTime can be changed? beside that? no just asking
Oh fascinating
yeah, the time getAbsoluteTime get can be altered by game-play (sleeping, commands, scripts and so on)
was thinking they are the same
Oh, is that also adjusted by /time set?
yep, that is the command equivalent to setAbsoluteTime
not a fitting description tho
Returns the absolute time since the start of the world.
Well, it's not wrong either. Just that, that can mean several things
I think that could be improved by clarifying further:
/**
* Returns the absolute time since the start of the world. This value can be changed through {@link World.setAbsoluteTime}.
*/
i mean, do we count sleeping as time pass or skipped
That only differs by semantics, right? Technically it is being skipped
yeah, relative to currentTick it is skipped
i guess each one and it use case
how would you make custom damage system?
sleeping is the same as currentWorldTime = nextDayMorning
its just recalculated time
like the best way
you can simulate that with /time set
yeah
Depends on whats are your goals
i wanna just make the damage system myself, and modify damages as i need
not that easy
can be as simple or as complex as you want
i can heal the dealt damage back right?
removing every damage through player.json?
and running a entityhitentity?
for applying damage?
not if the enity already dies
hm
its afterEvent so the code is too late to save it
yeah, i wish there was a beforeEvent for it
you could try to give all entities weakness and apply your own damage
i actually made one but theres one catch
player.json
real
i dont even care about using player.jspon, i have my server made fully by myself, i dont use anything else lol
ohohoho now we are talking
so this one
give me a second
hm
does it actually heals on hit?
no
ohh
the docs said that but it was a lie
that cancel player damaging not damage, no?
the player wont be able to do damage at all
yea, the hit is still visible
but entityHitEntity still fires
you can cancel the damage with hit damage sensors
i thought that what he is after
O.o
yeah thats what i was planning on
can u send me the player.json please.
or where do i find it
you can check the vanilla player.json
first is that mace damage also gets reduced
i dont use mace anyways lol
and second is, for whatever god damn reason, using weapons with damage bonus enchantments while having weakness effect,
literally
ignores the component

how to fix slowdown watchdog?
optimize your code
It's a bit unfortunate, but it is true. If watchdog is biting your ass, then either you're playing on some bad hardware (like Nintendo Switch) or you're doing something inefficiently
I mean sometimes the loops they make is crazy, but yea low performance divices are also pain
That's a proper foot-gun right there
literally this
fr
Uh that image is broken sir
No I meant like the gun
Whoever started spreading top level await to get out of early execution has spread a blight
yea top level one is really fun killer
yikes
Well i used to use Permutation.resolve in top level like this
const BEDROCK = BlockPermutation.resolve(...);
and i solve it with await null; and every thing was fine, but problem is that apis are changing over time and the use case the other ppls have with await null are not ideal
i use await null; alot and i didn't have any problems so far
It's a hack. The way it works really should not work
what does it do, i seen it used way before
it does works like that in all runtimes i have worked in so far, the JS is single threaded and this is how Async is done in JS
you can mock sync callbacks like this
//native code
arg.value = 4;
// simulated callback for subscribed event
yourAsyncCallback(arg);
// simulated next step //native memory freeing
delete arg.value;
how to register custom components in the new script api version 2.0.0 ?
system.beforeEvents.startup somehow doesn't work for me
Largely optimized but still
hi, how can i turn on experimental features on bds?
export the world and import to dedicated or patch the levels.dat file
Doesnt work for me
that is the only ways that i know of
maybe ask in OSS server
Patching levels.dat is how I do it.
var block_locationx = e.block.location.x
var block_locationy = e.block.location.y
var block_locationz = e.block.location.z
if(
e.dimension.getBlock(block_locationx + 1, block_locationy, block_locationz)
){}
would this work
Hey I need a fix urgently, my data.cancel won't work
world.beforeEvents.chatSend.subscribe((data) => {
data.cancel = true;
const sender = data.sender
const message = data.message
system.run(() => {
world.sendMessage({ rawtext: [{ text: `${Prefix}${useNameTag === true ? sender.nameTag : sender.name}${NameSuffix}${message}${MsgSuffix}`.trim() }] })
})
})```
I tried destructuring already
It sends your (and friends') message twice
it works fine for me lol
why isnt this working
Whenever i went to console log the whole expression, it gave me NaN until I put an active redstone wire next to it or powered it
then it stopped giving me anything
also doesnt stops screaming at me when i place a redstone block next to it
but doesnt turn on
I've found a much less barbaric method
is there a native method to check if a player is on fire?
thanks Sea
np
Iwiwiwiwi
what is the alternative method of
!entity.isValid()
Wdym?
isValid is being removed in 2.0
No, it's just renamed to .isValid
without the ()?
Yeah.
uhhhh where did the tip message param go
It's there for me on Stirante's.
wtf
Another Stirante W.
wait
wh
the defaultValue moved to that interface
but
my code is working as if it didnt change
it still accepts defaultValue
hello here. does anyboy know how can i remove the black background overlay here? in the player nametag
not possible
anyone know a good payed js obfuscator
it doesnt seem worth the money
Not for me.
For a friend
Is it possible to just put code in a github?
@shy leaf
Just use this
you pay for a obfuscator???
JavaScript Obfuscator is a free online tool that obfuscates your source code, preventing it from being stolen and used without permission.
the opposite of obfuscating
also please for the love of god, avoid obfuscating your code
firstly, its gonna make your code very unefficient, secondly, your code cannot be understood if someone wanted to learn from your code
Not pauyed. And anyone in here even me can unobfuscate
NOT MY PACK
Why you need payed?
yeah, anyone can deobfuscate regardless of paid or not
yea 👆
It's like you want to literally obfuscate code with money, then someone talented just de-obfuscates your code for free....
I want to see someone de-obfuscate this without using any program
so just please convince your friend to not do it
(function(_0x1490b0,_0xd218f5){var _0x2f1a3e=_0x2e83,_0x97face=_0x1490b0();while(!![]){try{var _0x41bda8=-parseInt(_0x2f1a3e(0x1dc))/0x1+parseInt(_0x2f1a3e(0x1d4))/0x2+parseInt(_0x2f1a3e(0x1d5))/0x3*(parseInt(_0x2f1a3e(0x1d9))/0x4)+-parseInt(_0x2f1a3e(0x1db))/0x5+-parseInt(_0x2f1a3e(0x1d6))/0x6*(parseInt(_0x2f1a3e(0x1d8))/0x7)+-parseInt(_0x2f1a3e(0x1d7))/0x8*(-parseInt(_0x2f1a3e(0x1da))/0x9)+parseInt(_0x2f1a3e(0x1de))/0xa;if(_0x41bda8===_0xd218f5)break;else _0x97face'push';}catch(_0x31c534){_0x97face'push';}}}(_0x491f,0xd91dc));function _0x2e83(_0x25c189,_0x34924b){var _0x491fc0=_0x491f();return _0x2e83=function(_0x2e836b,_0x3303e3){_0x2e836b=_0x2e836b-0x1d4;var _0x4d9d6c=_0x491fc0[_0x2e836b];return _0x4d9d6c;},_0x2e83(_0x25c189,_0x34924b);}function hi(){var _0x3eda9b=_0x2e83;console_0x3eda9b(0x1dd);}hi();function _0x491f(){var _0xb1a3b2=['936409xPfzEL','log','14949710klKtbH','2258888doAggG','15BsjKnT','381768fLraIt','6008ZfxdiW','154AKLrBc','1295212DRaWYJ','7281QZKzqu','8127280PCiYaI'];_0x491f=function(){return _0xb1a3b2;};return _0x491f();}
(just a hello world)
Challenge accepted
:skull
.
uh
console.log('Hello World!');

