#is it possible to override a java method from a specific mod?
118 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
im 100% sure i remember seeing a config option for those
or like a command to disable them
oh, the april fools one aswell
he added a config option to set the rarity to some ridiculous value, but i can't update the mod without breaking the modpack on my server, and... well, that's not a fucking solution, it should be disableable
TQcraft 2 days ago
I have checked every single entry of corail tombstone configs and there is no way to disable this...
I made a post on corail tombstone github for issues.
UPDATE: Dev instantly closed my post. Comment from dev: "They only spawn around players, not in all dimensions, with a timer. They have no reason to be disableable."
I guess this dev is not very intuitive about how changes are perceived by other players. How obvious is it that adding random items that get auto picked by magnets etc. around every single player would be infuriating? Easter eggs just been out a few days and already see posts about it.
``` https://www.reddit.com/r/allthemods/comments/1bk602e/easter_egg_spawn_to_much/
the dev's an ass
ikr
why wouldnt you add something so easy wtf 
it would take at most 5 mins to implement this
by default they're literally everywhere, causing server lag, and clogging my player's inventories
unless theres an event for them spawning, i dont think you can disable them with KJS currently
i think you'd need a mixin for that
no way to use reflection to overwrite the method?
i'll try looking for one, but its closed source
yes...

i think an easy way would be to literally make the most minimal mod that mixins into it and changes it
but this is pure undiluted cringe like wtf
could i do that server-side only?
yeah,, my thoughts exactly, i encountered the easter eggs, went to look at how to disable them, found that they're not disableable, found that it's closed source, and my first reaction was "Why are pack devs still using this mod"
it doesn't look like there's an event for it unfortunately
don't ask me how i know... but they're spawned in the onPlayerUpdate event
KJS can only do it if the mod is calling an event which will then spawn them
right uh,, one sec
yeah, doesn't look like it's calling any events, unless, is there an event for when an entity is added into the world?
right, are those cancelable?
yes
lol
called by addFreshEntity?
its whenever a mob is added, i dunno what triggers it
how do i register an arbitrary java event in kjs?
you mean register a new event, or hook into an existing one?
well, register a listener
ForgeEvents.onEvent('event here', e => {})
in startup, always
okey ty
This event is fired whenever an Entity joins a Level. This event is fired whenever an entity is added to a level in LevelWriter.addFreshEntity(Entity) aight nice, EntityJoinLevelEvent,, how do i know if its cancellable? or,, i suppose i can just delete the item if it's the easter egg
oh wait it says here it is cancellable
wait wait,, if it's in startup doesn't that mean it needs to be on clientside aswell?
in the "event here" part, does it need to be the full classpath, or just EntityJoinLevelEvent
https://mcstreetguy.github.io/ForgeJavaDocs/1.20.1-47.2.0/net/minecraftforge/event/entity/EntityJoinLevelEvent.html, so net.minecraftforge.event.entity.EntityJoinLevelEvent?
wait why are you adding a forge event to an existing KJS event?
wait KJS has this event?
i looked up checkSpawn, and it said it's only called on mob spawns
checkspawn is before a mob spawns
its the event that checks if a mob can spawn, which is used to stop a mob from spawning without it showing up for a split second
i guess,, the EntityEvent.spawned event is EntityJoinLevelEvent??
i got confused, cos i missed the EntityEvent section in the kjs event list,, and started looking thru forge docs lmao
https://github.com/AllTheMods/Gravitas2/blob/0ae3a242caeab89eaffcc359973136fc6d686760/kubejs/server_scripts/main_server.js#L80
I replace item entities here without any problem
using kubejs event
you may be able to destroy/discard/kill the entity
also shameless plug here
You can find online JavaDocs for Forge/NeoForge and Fabric by clicking the button.
If you want to see classes added by Minecraft, choose Forge/NeoForge.
If the page doesn't load, click the "Status" button or ping @woven sun.
ah,, i use these https://mcstreetguy.github.io/ForgeJavaDocs/1.20.1-47.2.0
package index
welllll you only have the latest forge version for any given minecraft version,, i want specifically 47.2.0 :p
nothing is different really lol
cuz you cant see code
and you should also update to the latest, if youre not on it
recently I was checking how to get one .dev domain and there was so many options ti buy lol, which one did you choose?
47.2.0 is what ATM9 is on 
EntityEvents.spawned(e => {
let toCancel = [
'tombstone:easter_egg' // eat shit
]
if (toCancel.includes(e.entity.item.id)) {
console.log(`prevented spawn of: ${e.entity.item.id} at ${e.entity.x}, ${e.entity.y}, ${e.entity.z}`)
e.cancel()
}
})
```this should handle it, testing it now
im getting my domains from namecheap
noice
e.entity is the mobs that spawns
i thought you wanted to see if the mob was spawned from a spawn egg
no, corail tombstone drops these easter eggs on the floor everywhere
look how frequent this shit is, there are THREE people online
and this doesn't need disabled.... my ass
afaik, that config is in an update to the mod that ATM9 hasn't updated to yet
and it's still not a solution
it should be disabled entirely
oop, if a player already had an easter egg, and tries to drop it, it gets deleted 

can i like,,, get the source of the event or smth?
and not cancel it if it's an item that a player dropped
maybe check the entity nbt to see if theres some info
ngl, I'm ok with it because you are already cancelling all
on a fresh world no one is supposed to have it
ah, seems like the NBT has a "thrower" tag, when it's something that's been dropped by a player
EntityEvents.spawned(e => {
let toCancel = [
'tombstone:easter_egg' // eat shit
]
let entity = e.entity
let item = entity.item
let thrower = entity.nbt.Thrower
if (thrower) {return}
if (!item) {return}
if (!toCancel.includes(item.id)) {return}
//console.log(`${entity.nbt}`)
//console.log(`prevented spawn of: ${item.id} at ${entity.x}, ${entity.y}, ${entity.z}`)
e.cancel()
})
``` is this right? `entity.nbt.Thrower`?
ok yah, seems to work
ty guys!
Ticket closed!


