#simple trail system
1 messages · Page 1 of 1 (latest)
it's great, but maybe adding a one second tick could help, not sure I never tested it.
idk if a 1 second tick you just added would help lol, 20 is equivalent to an actual second.
but when you do that, look at the particles because they might be ruined or delayed.
yeah, I thought you wanted to make it a second
I don't know if a millisecond would make much difference
20 minecraft ticks is a full second.
Roughly. Lag will definitly change it.
Gotcha. I meant serverside lag in general.
Is the const part neccesary?
No. I was wanting to use it, I was just wondering if the const was neccesarry for the script.
import { world, system } from "@minecraft/server";
system.runInterval(() => {
for (const player of world.getAllPlayers()) {
const
{ location, dimension } = player,
effectId = player.getTags().find(find => find.startsWith("trail:"))[0];
dimension.spawnParticle(effectId, location);
};
});
💀 bro respect beginners
it's not even that advanced
@ripe plank i tried to Modifiy it a bit, i hope its good
import { world, system } from "@minecraft/server";
// trails, you can easily add some
const trails = [
[
'1',
'minecraft:basic_flame_particle'
],
[
'2',
'minecraft:totem_particle'
],
[
'3',
'minecraft:villager_happy'
],
[
'4',
'minecraft:villager_angry'
],
[
'5',
'minecraft:lava_drip_particle'
],
[
'6',
'minecraft:enchanting_table_particle'
],
]
system.runInterval(() => {
for (const player of world.getAllPlayers()) {
const location = player.location
trails.some((trail) => {
if (player.hasTag(trail[0])) {
player.spawnParticle(trail[1], location);
return true // if you want that the player can have multiple particles at the same time, just remve the returns and instead of using 'some' use 'forEach' :D
} else {
return false
}
})
}
}, 1)
consider using map data structure
right would be better
a db would be the best option so you can change/delete or set the trails from offline players
but for this small thing a tag system is enough
yeah
Would this not work just as good?
const particles = [
{
tag: "test",
particle: "minecraft:basic_flame_particle",
}
]
system.runInterval(() => {
for (const player of world.getAllPlayers()) {
const tags = player.getTags()
for (const particle of particles) {
If (tags.include(particle.tag)) {
player.runCommand('particle ' + particle.particle + ' ' + player.location.x + ' ' + player.location.y + ' ' + player.location.z)
}
}
}
}, 1)
There are probably some errors, just typed this out on my phone on discord
But if it just a donator option it fine