#Script to make it so a command runs when the player gets an advancement.
31 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Paste version of dimension_difficulty_set.js from @charred dagger
Bruh it finally works. Thanks a lot
Just in case i'm going to put this here
(thought this was wrong but it can be use to run commands per player)
Paste version of dimension_difficulty_set.js from @charred dagger
Ticket re-opened!
Wait, now i have to make it so it's a global thing
Cause if the end advancement it's unlocked first by one player and then another player unlocks the nether advancement it will set it back to 62
PlayerEvents.advancement(event => {
let player = event.player
let pdata = event.server.persistentData
if (player.isAdvancementDone("minecraft:story/enter_the_nether")) {
if (pdata.nether) return
player.runCommandSilent("improvedmobs difficulty set 62")
pdata.nether = true
}
if (player.isAdvancementDone("minecraft:story/enter_the_end")) {
if (pdata.end) return
player.runCommandSilent("improvedmobs difficulty set 94")
pdata.end = true
}
})
try something like that
This one only triggers the command when i go to the nether, but not when i go to the end
yes
Think i got it
wait a second
yeah i got it
This one works fine
(This only runs the command the first time the advancement has been completed)
Paste version of dimension_difficulty_set.js from @charred dagger
or maybe server.runCommandSilent ?
that just makes it so it doesnt show in the chat, but still executes it
Not sure if there will be a player permission problem.
Thank you a lot.
Ticket closed!
Script to make it so a command runs when the player gets an advancement.
Ticket closed!
you keep opening the ticket xD
