#New person, need help with simple script!

179 messages · Page 1 of 1 (latest)

fast wharf
#

Hello uhm, I have never touched this kinda code in my life, and have no idea where to begin. I am not looking to use this mod a lot truth be told, I am mostly here out of necessitiy to remove a few specific enchantments I don't like. What tutorials would you recommend for getting this goal done? Given that I don't plan to use this tool that often if at all after this.

mortal belfryBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

fast wharf
#

hjelp

#

pls

#

uhm

#

hoii

#

aaaaaaaaaaaaa

#

i was also sent here with the following instructions but idk what hey mean or how to implement them, if this helps:
"Which, iirc, can handle arbitrary java events, so you should be able to hook dev.shadowsoffire.placebo.events.GetEnchantmentLevelEvent and use it to force the effective levels of the enchantments you want off to zero"

fast wharf
#

help

#

please

fast wharf
#

Hiii

fast wharf
#

Hello

#

Pleaseee

lethal prairie
#

Uhhm

#

??patience

grave ospreyBOT
# lethal prairie ??patience

Please be patient, we're helping as fast as we can
We volunteer our time and knowledge to help people as we can.
Not everyone here will have your answer the moment you want it.
Time zones, work/life/schedules etc. also change when people are available to help.

TL;DR: Please have patience. IF and WHEN someone knows, they will assist you.

bitter frost
#

hmm

lethal prairie
#

And

#

What exactly do you want

#

/ need

#

You wnat to remove enchantments

bitter frost
#

not sure how to begin to about it using KubeJS, but I'm sure somebody else here may know

fast wharf
#

And the apotheosis discord is about as helpful as asking a person who just slammed 8 drinks exact directions through a maze.

#

So I’m here tryna fix it bc I have no other options

fast wharf
# lethal prairie / need

Yeah I just wanna remove enchantments. However the wiki is all over the place and the only video tutorials are just about ultra generic things which I wouldn’t really wanna learn as, well as I said in the main blurb I’m mostly here because short of coding a mod to do this myself I have no options

bitter frost
#

I'm surprised that the config isn't workiing

#

out of curiosity, what's not working with it?

fast wharf
#

Any changes I make the enchanting config simply don’t apply to looting chests

#

Which is a problem because I’m trying to add balance to apotheosis and the base mod was designed with the unironic principle of “Eh who cares if this feature is not just objectively useless but only causes harm i want it so let’s add it anyways.”

fast wharf
#

Bump

zinc cairn
#

and you're creating a new world or going ~1k blocks every time you change/update the config after restarting your game, not world?

fast wharf
zinc cairn
#

fair enough

fast wharf
#

saves time

zinc cairn
#

I'm not sure it does nbt data, but you could use LootJS to do it

fast wharf
#

and im not gonna randomly delete mods bc A: that would take too long and B: unless its a optimization mod that actually secretly sucks

#

i can't remove mods from the pack

#

used chunky for the world n' its a server

barren tapir
#

i think quark has a built in enchantment disabler

#

in the common.toml theres an enchantments.begone section

fast wharf
#

Thank god

#

You’ve saved my soul

#

I gotta check if my version of quark runs that

fast wharf
zinc cairn
#

what specific enchants are you trying to remove?

fast wharf
fast wharf
#

Blame apotheosis for being quirky and letting them stack with normal prot

#

And completely bricks balancing

barren tapir
fast wharf
fast wharf
#

Sofar looking like it’s not an option

#

Hence why I’m here

#

I’m entirely out of other options to try and remove enchantments 😵‍💫

bitter frost
#

out of curiosity... have you attempted to remove the enchantments on a minimal instance with just quark or apotheosis?

#

to rule out whether there's an incompatibility somewhere

fast wharf
#

It’s just that this pack I made as very carefully constructed and unless it’s a optimization mod causing it

#

I can’t remove whatever’s causing this

bitter frost
#

maybe not, but at least you could rest well knowing that it's not those mods in particular

#

and report the incompatibility to the respective mods

fast wharf
#

not to mention that even if i do fix it the damage has already been done

#

and items with the enchantments i want gone exist

#

i need a solution thats far more permanent

#

that gets rid of the enchantments entirely.

#

hence

#

i need a script

#

so with allat being said uhm...

#

where should i start

#

😵‍💫

#

i still have no idea how to work with kubejs and all the tutorials are for blocks or items n' such

zinc cairn
#

it uses MoreJS (a KubeJS add-on) but-

fast wharf
zinc cairn
#

it says "for enchantment tables, entity items and other stuff"

fast wharf
barren tapir
#

huh

#

enchantment are server-side registries so it probably does outright bomb it

#

i would tryitandsee first before writing it off because i also was going to suggest this next hmmm

grave ospreyBOT
fast wharf
# zinc cairn it uses MoreJS (a KubeJS add-on) but-

Did I do this right? I don't have whatever formatting thing I need to make this show properly however I think I copied the code here properly???


// Visit the wiki for more info - https://kubejs.com/

MoreJSEvents.filterAvailableEnchantments((event) => {
    event.remove("minecraft:fire_protection");
    event.remove("minecraft:projectile_protection");
    event.remove( "minecraft:blast_protection");
    event.remove("minecraft:smite");
    event.remove("minecraft:bane_of_arthropods");
    event.remove("minecraft:impaling");
    event.remove("apotheosis:icy_thorns");
    event.remove("apotheosis:rebounding");
});
#

i put it in server scripts bc i think thats where that should go???

zinc cairn
#

you did it correctly, yes

fast wharf
#

currently loading it up now

grave ospreyBOT
#

Paste version of ApotheosisBeGone.js from @fast wharf

fast wharf
#

incase you'd like to fact check it

zinc cairn
#

however, when I attempted to use it earlier, it only took enchants away from obtaining enchants, not items that had them before the script was made

fast wharf
#

yeah i was about to point that out

#

also lemme check if it actually fixed them appearing in chests

zinc cairn
#

spam the /loot command

#

I don't use Apotheosis mainly because I don't like the gems much & it crashes half the time I add it to my own packs

zinc cairn
#

you could just remove Apotheosis

#

idk what all it does

fast wharf
#

small issue as much as i bully apotheosis

#

it is

#

single handedly holding up the entirety of endgame customization

#

in place of like

#

15 mods that add

#

like

#

20 items each that i'd only want 4 of

#

apotheosis plus a few really, really good mods that centralize around a few specific weapons with a lot of unique abilities and 4 different armor sets with unique abilities

zinc cairn
#

you could use the combination of lootjs and morejs to make enchants harder to obtain

fast wharf
#

issue isn't them being hard issue is apotheosis making them game breaking.

#

because that mod was made by a bunch of bumbling fools and i wish there was a mod like apotheosis out there that wasn't somehow worse than apotheosis is.

#

i need them gone gone

#

completely erased

zinc cairn
#

the reason they're game-breaking is because of the combinations?

fast wharf
#

and we have origins

#

and theirs an entire faction of magic that gets affected by smite

#

it would legit lock away like half the origins and an entire ass playstyle away because funny smite stacking

#

same logic applies to projectile protection and the rest of the bunch.

#

it is the single stupidest design decision

#

and you can't even disable it

#

because as i said prior

#

apotheosis devs have actually just zero foresight

#

infact im pretty sure they have like a tiny but but only because their foresight was so low it integer overflowed back into being a positive value.

zinc cairn
#

have you checked if it was a /gamerule?

fast wharf
#

i talked with the devs directly its just not a option

zinc cairn
#

ah ok

fast wharf
#

i have exhausted every single avenue i possibly could here minus bomb the enchantments from orbit 😵‍💫

#

which nothing i've tried worked

fast wharf
#

so im SoL there

#

and now even when i turn to code its seeming to resist everything i try to remove it ;- ;

zinc cairn
#

I'd say it's an issue with file load order, but I know not if it is nor how to change that

zinc cairn
fast wharf
#

because configs, scripts, and other mods can't seem to fuckin get rid of them

#

and i have no clue which mods the problem mod nor do i believe i could get rid of it if i wanted to

zinc cairn
#

like I said: load order

fast wharf
#

bc as i discussed prior this pack is ultra particular

#

every individual mod here has a very specific role to play

#

if i remove one mod everything crumbles unless its like

#

an optimization mod

zinc cairn
#

what's the exact use case you need apotheosis for?

#

because if it's just extra stats, then a skill tree mod could be a replacement

#

I have one in my pack that allows for customization of the xp required for each lvl

fast wharf
zinc cairn
#

I know what neither of those are so I could not help you

fast wharf
#

tl;dr

#

if the skill tree mod so much as does its coding even slightly different it could break balance in two

#

bc weapons and spells in general have ways to apply ranged attacks

zinc cairn
#

fair enough

fast wharf
#

so i need the semi-sub abilities to apply only on regular vanilla melee hits

#

exclusively

#

with the exception of certian ones like rainfall serenity.

zinc cairn
#

thus the gems

#

I apologize, but I've run out of ideas to help, I'm afraid

fast wharf
#

everywhere i've gone has been dead end after dead end after dead end...

#

i can't even use fuckin custom code to fix it

#

i thought at least kubejs would have something, anything for me to just send the enchantments to hell

zinc cairn
#

if there is something, idk of it

#

someone else might?

fast wharf
#

i mighta got a

#

maybe lead?

#

how does itemevents.crafted work like

#

exactly.

#

because we have a custom way of applying enchantments with MnA and i have no idea if that'll just

#

entirely bypass anything i try and do

#

i have no info on this bc

#

wiki is silly!

#

but if anyone knows this or any simpler solution to send enchantments to hell

#

PLEASE let me know

#

Or if you just have anything for this I’m desperate I’ll take anything

bitter frost
#

if you can't remove enchantments directly, I wonder if there's a way to edit the NBT of the item when it enters the inventory to remove the enchantments you don't want? 🤔

#

the loot tables may be bloated with enchantments that will be deleted, but I don't see any other workaround

bitter frost
fast wharf
#

It took them half a fuckin decade to put a toggle on that.