#Infused SMP Datapack from prv version

1 messages · Page 1 of 1 (latest)

vale breach
empty ospreyBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1724713652:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

vale breach
#

quick thing: i dont have any friends to test it on

#

i downloaded this off the internet btw

#

so well, i tried to update it bcs it hasnt been updated in like 2 yrs

crystal portal
#

I wouldn't count on anyone downloading the data pack to comb through it for mistakes without any kind of idea of what they should be looking for.

#

Besides, if you're not able to test it without other people, what makes you think anyone here will be in a better position to do so?

vale breach
#

the general thing is if you kill someone, you gain a good potion effect and they obtain a bad potion effect.,

#

basically permanently

#

then killing ppl removes those negative effects

crystal portal
#

That's not really what I meant when I said "some kind of idea of what they should be looking for"

#

We're generally here to help you solve a problem that you know exists, but don't know how to fix

vale breach
#

i mean more or less. i know some names gotr changed from 1.20-21

#

i dont know if i renamed everything probably

crystal portal
#

Going through a pack's code to confirm if it works is pretty hard especially without an idea of what was changed or what might be broken in specific

crystal portal
hallow socketBOT
#
Updating Datapacks Past 1.21

1.21 renamed many folders that make up a Minecraft datapack, breaking virtually all datapacks from prior versions. Now, all folders which previously had plural names, except tags, now have singular names.
Below is a list of all folder names changed in 1.21:
structures -> structure
advancements -> advancement
recipes -> recipe
loot_tables -> loot_table
predicates -> predicate
item_modifiers -> item_modifier
functions -> function
tags/functions -> tags/function
tags/items -> tags/item
tags/blocks -> tags/block
tags/entity_types -> tags/entity_type
tags/fluids -> tags/fluid
tags/game_events -> tags/game_event

vale breach
#

k ty

whole forge
#

But if it does stuff with items, you'll likely need to update to components too

vale breach
#

k

vale breach
#

I was able to test this. How do I make so instead of calling upon the same list of effects, how do I make it random each time?

crystal portal
#

How is it currently handling the effects?

vale breach
#

it comes out in a single order:

#

effect give @a[scores={effect=1..}] luck 2 0 true
effect give @a[scores={effect=2..}] speed 2 0 true
effect give @a[scores={effect=3..}] haste 2 0 true
effect give @a[scores={effect=4..}] strength 2 0 true
effect give @a[scores={effect=5..}] resistance 2 0 true
effect give @a[scores={effect=6..}] conduit_power 2 0 true
effect give @a[scores={effect=7..}] fire_resistance 2 0 true
effect give @a[scores={effect=8..}] dolphins_grace 2 0 true

effect give @a[scores={effect=..-1}] unluck 2 0 true
effect give @a[scores={effect=..-2}] slowness 2 0 true
effect give @a[scores={effect=..-3}] mining_fatigue 2 0 true
effect give @a[scores={effect=..-4}] weakness 2 0 true
effect give @a[scores={effect=..-5}] hunger 2 0 true
effect give @a[scores={effect=..-6}] glowing 2 0 true
effect give @a[scores={effect=..-7}] jump_boost 2 0 true
effect give @a[scores={effect=..-8}] slow_falling 2 0 true

.

#

function/server/effects.mcfunction

#

i would rather it be a list that the function would come from randomly

#

this is kill.mcfunction: scoreboard players add @s effect 1

#

this is death.mcfunctions: scoreboard players remove @s effect 1

crystal portal
#

Well you won't be able to do exactly that, but you can make the effect that gets applied random, certainly

vale breach
#

thats what im hoping for

crystal portal
#

So the effect scoreboard is basically just how many times the player has killed a player?

vale breach
#

yes i am pretty sure

crystal portal
#

Minus how many times they've died

vale breach
#

yes, that sounds right

crystal portal
#

And all you want is that whenever a player kills another player or dies, they get a random effect

vale breach
#

yep. a random effect from the list

#

bcs a death = negative
bcs a kill = positive

crystal portal
#

In that case, you can just change both the kill and death functions to have this command:
execute store result score @s effect run random value -8..8

crystal portal
vale breach
#

alr ty

vale breach
# crystal portal And then change this function so all of those effect score checks are just the e...

so this

effect give @a[scores={effect=1}] luck 2 0 true
effect give @a[scores={effect=2}] speed 2 0 true
effect give @a[scores={effect=3}] haste 2 0 true
effect give @a[scores={effect=4}] strength 2 0 true
effect give @a[scores={effect=5}] resistance 2 0 true
effect give @a[scores={effect=6}] conduit_power 2 0 true
effect give @a[scores={effect=7}] fire_resistance 2 0 true
effect give @a[scores={effect=8}] dolphins_grace 2 0 true

effect give @a[scores={effect=-1}] unluck 2 0 true
effect give @a[scores={effect=-2}] slowness 2 0 true
effect give @a[scores={effect=-3}] mining_fatigue 2 0 true
effect give @a[scores={effect=-4}] weakness 2 0 true
effect give @a[scores={effect=-5}] hunger 2 0 true
effect give @a[scores={effect=-6}] glowing 2 0 true
effect give @a[scores={effect=-7}] jump_boost 2 0 true
effect give @a[scores={effect=-8}] slow_falling 2 0 true

crystal portal
#

Looks right

vale breach
#

kk

crystal portal
#

Oh technically there's a chance for the effect to be 0, which doesnt have an effect specified. If you don't want that, you can either add one, or you can just re-number all the effects to be from 1 to whatever, and change the random command range to match

vale breach
#

kk ty

#

also, is there a way to make the death the inverse of what they randomly gained?

#

if not, then what you've helped me with so far is perfect

crystal portal
#

Technically yes

#

Exactly how is gonna vary. It's not particularly hard, but if you don't even really understand what we've just done, maybe now's not the time for that

vale breach
#

alr! leave that off the table then lol

#

tysm!

empty ospreyBOT
# vale breach tysm!
🎗️ Is your question resolved?

If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D

vale breach
#

i am not resolving it yet

vale breach
crystal portal
#

It is supposed to be store

#

We're storing the result of the random command to the effect score

vale breach
#

kk. and last question:

#

death.mcfunction : execute store result score @s effect run random value -8..-1

#

kill.mcfunction : execute store result score @s effect run random value 0..8

crystal portal
#

What's the question?

vale breach
#

Oh my bad forgot to hit send

vale breach
crystal portal
#

That's one way to do it, yeah

#

Very good

vale breach
#

Now i gotta go learn how to code one from scratch lol

empty ospreyBOT
#
Question Closed

Your question, #1277758859888558255 (Infused SMP Datapack from prv version), was resolved!

Original Message

#1277758859888558255 message

Duration open

5h36m

vale breach
crystal portal
#

Well you'd also need to modify the function that gives the effects

empty ospreyBOT
empty ospreyBOT
crystal portal
#

Right now it's giving the player a single effect relative to their effect score, which can only be one value at a time. You'd need to instead give them something they can possess multiple of, like a tag, and apply each effect of the player has the corresponding tag

empty ospreyBOT
empty ospreyBOT
empty ospreyBOT
empty ospreyBOT
empty ospreyBOT
empty ospreyBOT
crystal portal
# crystal portal Right now it's giving the player a single effect relative to their effect score,...

This is relatively easy, though it may come with some additional logical questions. Why don't you give this a try and see if you can put into practice what I described: basically after the kill and death functions set the effect score to a random number, check the player's effect score and give them a tag (probably the name of the effect you want to give them). Then in the function that gives the effects, instead of checking the player's effect score, check if they have the corresponding tag

#

And then if those logical questions come to you, we can tackle those.

vale breach
#

would that work too?

#

i basically just combined what it did originally from a list, and would that just make it random?

crystal portal
#

No, for one that's not correct syntax

#

And for two even if you made it work correctly, it would still leave the effect score with a single value, so the way your function that gives the effects currently works, the player would still only get one effect at a time

vale breach
#

ah. kk ty

vale breach
crystal portal
#

The same way you were previously

vale breach
#

ye.

#

Actually never mind abt this. i may actually just modify this datapack to give items instead of just effects

vale breach
crystal portal
#

Add a score check to the target selector that checks if the score is less than or equal to -1

vale breach
#

k

vale breach
#

effect give @a[scores={effect=..-1}] unluck 2 0 true
effect give @a[scores={effect=..-2}] slowness 2 0 true
effect give @a[scores={effect=..-3}] mining_fatigue 2 0 true
effect give @a[scores={effect=..-4}] weakness 2 0 true
effect give @a[scores={effect=..-5}] hunger 2 0 true
effect give @a[scores={effect=..-6}] glowing 2 0 true
effect give @a[scores={effect=..-7}] jump_boost 2 0 true
effect give @a[scores={effect=..-8}] slow_falling 2 0 true

#

but then i still need it capped at 0 so nm

crystal portal
#

That's essentially going back to the old system, but it's certainly allowed

vale breach
#

ye. i am reworking it to smthn else

#

i want to the negative effects in order without any of the positive effects happening

#

then after i am going to make a list where it has custom potions, and then the list just gets called on in kill.mcfunction

vale breach
crystal portal
#

What do you mean by a cap?

vale breach
#

prevent the number from going over 0

crystal portal
#

Why would you need that in the effects function?

crystal portal
vale breach
#

k.

#

is there a way for me to instead making it then when effect score = 1 to subtract 1 effect score?

vale breach
#

this is what i got so far

#

how do i make it subtract the score by 1?

crystal portal
crystal portal
vale breach
#

k

vale breach
#

this it?

crystal portal
#

If you only want to remove 1 if their score is 1, then that line's syntax is incorrect.

#

Try writing it in-game to see how the game expects it to be written.

vale breach
#

perfect

#

kk

vale breach
#

why is the second half incorrect?

crystal portal
#

Because like I told you, the syntax is wrong.

crystal portal
#

Pay attention to what the game is telling you. You're missing a very simple thing

vale breach
#

the command there is off, but i am not sure what should be used in the middle there

#

run, right?

#

execute if score @s effect matches 1 run scoreboard players remove @s effect 1

vale breach
crystal portal
#

Ok

#

Missing some of that first line, assuming that's a copy paste error

vale breach
#

ye

#

so that should be it for this part.

vale breach
#

and i added this to kill.mcfunction: execute store result score @s kill run random value 10-0

#

there is already a value for kills, so I am just using that

#

and i will probably add more to that potions.mcfunction

#

should this work so that the player gains a random potion from the list when they get a kill

vale breach
#

i really appreciate it

vale breach
vale breach
#

This is my kill.mcfunction:

scoreboard players add @s effect 1

execute if score @s effect matches 1 run scoreboard players remove @s effect 1

execute store result score @s kills run random value 6..10

.

#

this is my potions.mcfunction:

give @a[scores={kills=10}] potion[potion_contents={custom_color:11550261,custom_effects:[{id:strength,duration:-1,amplifier:3},{id:glowing,duration:-1},{id:hunger,duration:-1,amplifier:1}]}]

give @a[scores={kills=9}] potion[potion_contents={custom_color:11550261,custom_effects:[{id:resistance,duration:-1,amplifier:3},{id:weakness,duration:-1,amplifier:3},{id:saturation,duration:-1,amplifier:3}]}]

give @a[scores={kills=8}] potion[potion_contents={custom_color:11550261,custom_effects:[{id:speed,duration:-1,amplifier:2},{id:strength,duration:-1,amplifier:4},{id:poison,duration:-1,amplifier:1}]}]

give @a[scores={kills=7}] potion[potion_contents={custom_color:11550261,custom_effects:[{id:unluck,duration:-1,amplifier:2},{id:hero_of_the_village,duration:-1,amplifier:4},{id:mining_fatigue,duration:-1,amplifier:2}]}]

give @a[scores={kills=6}] potion[potion_contents={custom_color:11550261,custom_effects:[{id:luck,duration:-1,amplifier:2},{id:haste,duration:-1,amplifier:2},{id:glowing,duration:-1,amplifier:2},{id:nausea,duration:-1,amplifier:1}]}]

#

it does everything else it is supposed to, except give a potion when you get a kill

#

this is my load.mcfunction

scoreboard objectives add kills playerKillCount
scoreboard objectives add deaths deathCount
scoreboard objectives add effect dummy

#

why isnt it giving any item when I kill someone?

crystal portal
#

Have you checked your kills score?

crystal portal
vale breach
vale breach
vale breach
vale breach
#

I tested it lol. I have no idea how, but it happens

crystal portal
vale breach
#

Again, ty for all the help u r giving lol