#Ninja Stars broke again and load functions not working.

1 messages · Page 1 of 1 (latest)

brisk lionBOT
#

<@&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:1724432202: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

#
⚠️ You already have a question open!

Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D

Open question: #1276258315512447097

loud shuttle
#

We don't just rewrite your code for you

#

We'll guide you through the process of rewriting it yourself

sudden fossil
#

I'm also aggrovated that my load functions don't work???????

loud shuttle
#

Show us the contents of your load function and we can help

sudden fossil
#

I have like 7

#

because I have 7 little datapacks for one big server project

loud shuttle
#

Why do you need 7?

sudden fossil
#

so one in each pack

loud shuttle
#

Ok

#

Well just tackle one at a time

#

One of them will be breaking the others

sudden fossil
#

Now the creature one works?

#

Uhm

#

ok

#

lets start 1 by 1

#

Okay first is the structures core datapack

#
    "values": [
        "safehaven_builds:install"
    ]
}
``` this is located in the minecraft name space:

then in the function name space I have ```scoreboard objectives add DMS dummy```
#

and that isn't added upon world load

loud shuttle
#

And that scoreboard command is in a function located at data/safehaven_builds/function/install?

sudden fossil
#

yes

#

function safehaven_builds:install

#

Question, do the tag files need to be in the function name space?

#

like instead of minecraft ?

loud shuttle
#

No, they have to be in Minecraft

sudden fossil
#

Ok

loud shuttle
sudden fossil
#

No

loud shuttle
#

Disable all other datapacks, because one bad load function can corrupt the lot

sudden fossil
#

now its loaded

#

actually let me back up

#

show you mu datapacks before that

#

this is the first of the list, a little datapack called nasty traps: ```{
"values": [
"dungeon_traps:install"
]
}


It's meant to do ```tellraw @s ["",{"text":"Prisms ","bold":true,"color":"aqua"},{"text":"Nasty Traps ","color":"green"},{"text":"has been installed for MC Version 1.20.4.","color":"blue"},"\n",{"text":"For latest version click here: ","color":"light_purple"},{"text":"Prisms MC Channel","underlined":true,"color":"dark_blue","clickEvent":{"action":"open_url","value":"https://www.youtube.com/channel/UCHg2ttKLFKRSmqPLdCCEoAQ"}}]
playsound minecraft:entity.creeper.primed master @s ~ ~ ~ 1 0.5
#

but wont

#

even when I reload with just the dungeon core and traps enabled

#

Question @loud shuttle could I just send my entire datapacks library from this world here?

#

then you can read each file 1 by 1 and see my system and tell me oh it's this pack

#

because otherwise this will take a few hours, or I can just dm them

loud shuttle
#

I don't have time to do that, sorry

#

I suggest you go through one by one, and figure out which is causing the issue

sudden fossil
#

Idk how to tell what's causing it

#

each one seems to be written right

loud shuttle
#

Just put something like say Loaded in each load function, and see which loads

#

But only enable one at a time

void sorrel
#

To add a little context to gears' request, if there is a syntax error in any load function, it actually prevents all other load functions from running, because of the way tags work. So none of your load functions are running, but the problem may only be in one of them. If you only enable one data pack at a time to test it, then you'll be able to identify which one(s) doesn't run on its own

sudden fossil
#

wtheck

#

I only loaded 1 pack

#

and it wont load the install

void sorrel
#

So that's probably the culprit

#

Let's see that load function

sudden fossil
#

but its written right wtheck mojang

#
    "values": [
        "dungeon_traps:install"
    ]
}```
void sorrel
#

That's the function tag

sudden fossil
#
playsound minecraft:entity.creeper.primed master @s ~ ~ ~ 1 0.5
say loaded_traps```
void sorrel
#

And to confirm, try running that function in chat in-game

#

(while that's the only data pack enabled, of course)

sudden fossil
#

success

#

All I have enabled is vanilla, fabric and this pack

void sorrel
#

You are able to run it in chat?

sudden fossil
#

yes

loud shuttle
#

That sounds like you have some sort of path issue then

sudden fossil
#

?

void sorrel
#

Yeah

#

Man I miss reactions

loud shuttle
void sorrel
sudden fossil
#

how

#

it is?

loud shuttle
#

Or the load tag is in the wrong place

sudden fossil
#

Okay now it works

void sorrel
#

Oh true

sudden fossil
#

but only says the say msg

#

it wont send the tellraw

#

or creeper sfx

loud shuttle
#

That's because this is the load function, there is no @s

void sorrel
#

Yep

#

@s means "the thing executing this command", which for the load function, is the server

sudden fossil
#

oh

#

now that works

#

so I fixed it

void sorrel
#

Very likely. But you'll probably want to go through this process for the rest of the packs anyway to be safe

sudden fossil
#

Now enable each pack 1 by 1 yes?

void sorrel
#

Yep

sudden fossil
#

ye

#

hey while I do that, kanokaroo

#

can you please see why the heck ninja stars wont even work

void sorrel
#

🦘

sudden fossil
#

if I send that one file as a .zip (file of folders with functions of corse)

void sorrel
#

No, that's not what we're here for, as Gears already explained

sudden fossil
#

I just want to be done with it ugh. fine

void sorrel
#

I'm happy to help you troubleshoot it

#

(though let's make sure it wasn't because of the load functions issue first)

sudden fossil
#

ye

#

ok next pack the base

#

works\

#

blocks works!

#

Oh I found a culprait

#

the entire creatures pack is not working

loud shuttle
#

Ok, let's dig into that then

sudden fossil
#

found it

#

I named the function incorrectly

loud shuttle
#

That does it

#

One small mistake and the whole set of load functions collapses

sudden fossil
#

works for the core structures pack

#

alright all working load wise

#

Now Ninja Stars still don't work and I have there functions setup properly

#

first fixing some big red datapack errors

#

Okay I am ready to do Ninja Star rewrites @void sorrel @loud shuttle '

void sorrel
#

Ok, so what is the expected behavior vs what is currently happening?

sudden fossil
#

What is meant to happen is you right click, it summons an armor stand, that armor stand either kills itself and drops a item if it can't find a hostile mob within a block radius of sixteen, or it teleports towards an entity and kills the mob. It's doing neither.

#

It spawns in, makes sound and particle, kills itself without a trace.

#

my tick function for throwable items has this

execute as @e[type=snowball,nbt={Item:{id:"minecraft:snowball",Count:1b,tag:{CustomModelData:2}}}] at @s run function sh2_items:throwables/ninja_star/tick
execute as @e[tag=ninjaStar] at @s run function sh2_items:throwables/ninja_star/star_tick

Obviously I've checked the functions work in game, but like it won't do anything

#

its almost as if it's being killed off too quickly?

#

here's the star tick function which is what the entity does when existing:

#Author: Prism_Skywalker
#Date: August 22nd 2024
#Description: Summons Ninja Star throwing entity.
######################################################
tp @s ^ ^ ^.5 facing entity @e[type=!#sh2_creatures:cant_spawn,distance=..16,limit=1,sort=nearest]
particle minecraft:crit ~ ~-1 ~ 0 0 0 0.1 100
scoreboard players add @s starLife 1
execute at @s[scores={starLife=150}] at @s run function sh2_items:throwables/ninja_star/kill_off
execute at @s unless entity @e[type=!#sh2_creatures:cant_spawn,distance=..16] run function sh2_items:throwables/ninja_star/kill_off
execute at @s if entity @e[type=!#sh2_creatures:cant_spawn,distance=..1] run function sh2_items:throwables/ninja_star/dmg_star```
#

the entity tag for cant spawn does exist, I've checked.

loud shuttle
#

Check the logs for errors. If there's an issue in any of these function, it could be causing a chain effect

sudden fossil
#

Oh I see

sudden fossil
loud shuttle
#

What work?

sudden fossil
#

Is my command order off?

sudden fossil
#

Okay I fixed it

#

and fixed scorpion stingers to be more reliable

#

thats run off the snowball with the custom item data