warjort
Members-
Posts
5420 -
Joined
-
Last visited
-
Days Won
175
Everything posted by warjort
-
First: That use of Integer.MAX_VALUE is going to cause an overflow. Use 100 or something for testing. Integer.MAX_VALUE + 1 = negative value But I think the correct way to do what you are doing is via a MobEffect, see LivingEntity.addEffect() Your right click would apply the effect and then the effect would add the modifier. It would also mean the effect is saved with the player so it would survive reloads of the game. You certainly can't change data in your Item. There is only ever 1 instance of that. Stored mutable data for an Item should be in the ItemStack nbt.
-
If you don't figure it for yourself and understand it, how will you know the code is correct? How will you fix bugs when it breaks? We are here to answer questions about forge, not teach you java or fix your code. Here is what you asked for, but how do you know I am correct? ๐ // First navigate to the class you were told to use PlayerList players = chatEvent.getPlayer().server.getPlayerList(); // Now send use the method you were told about players.broadcastSystemMessage(Component.literal("Hello"), ChatType.SYSTEM);
-
https://www.baeldung.com/java-method-in-javadoc#referencing-a-method-in-another-class ClassName#method is the javadoc name for the method ClassName.method() @diesieben07 told you it confuses people who don't write java professionally ๐
-
Server Crashed when forge started to load
warjort replied to BlueStarrySky's topic in Support & Bug Reports
You don't have X11 available so it can't display the GUI. Start the server with the nogui option. It goes after where you have "java -jar forge-xxx.jar" -
We can let the original poster clarify what they really want, then continue this "tangent" if it is still relevant.
-
My understanding is they want to apply a bonus based on which slot the item is in? There's no way for somebody to replicate this logic if they are using say a loot table function to do the override.
-
This isn't curseforge, it's a server installation. Looks like the installation didn't complete properly because this file is missing Reinstalling should fix it. Make sure it tells you the installation completed successfully.
-
My bad, I read that as a cache when it is as you say an override. The original poster should still use the ItemAttributeModifierEvent, otherwise if somebody does define an override their logic won't be invoked.
-
Game crashes whenever i try to add optifine
warjort replied to ItsjustaViper's topic in Support & Bug Reports
https://github.com/sp614x/optifine/issues/6974 -
[1.18.2] Method for iterating over blocks belonging to a tag
warjort replied to Daeruin's topic in Modder Support
And wrong, you should have been using the ore dictionary ๐ Vanilla would use Registry.BLOCK.getTag(BlockTags.LEAVES) but i guess the correct way to do it with forge is? ForgeRegistries.BLOCKS.tags().getTag(BlockTags.LEAVES) -
It won't work the way are you are doing it. Your method won't be invoked everytime. ItemStack.getAttributeModifiers() has some caching code that effectively does: if (alreadyCalculatedModifiers != null) { return alreadyCalculatedModifiers; } return callYourCode(); If you want something more dynamic that is called everytime, register for forge's ItemAttributeModifierEvent.
-
https://github.com/sp614x/optifine/issues/6974
-
https://github.com/sp614x/optifine/issues/6974
-
[1.18.2] Detect entity collision detection with same type entities
warjort replied to FantaLaTone's topic in Modder Support
Maybe Entity.push(Entity) is what you want? -
The problem is likely caused by the root certificates that are included with java. When you installed 1.18 those certificates were still valid, now they have expired (remember your java is old). By updating java you get more recent valid certificates. Of course, old java might not be the actual cause of your ssl handshake problem at all. It is just one of the common causes.
-
More villagers has not been updated for the most recent changes in forge. Your problem is forge for 1.19 has not had a stable/recommend release yet so not all mods will work (unless they are quickly tracking changes in forge).
-
biomesoplenty needs the terrablender mod installed
-
Minecraft does that when you for example setTame() on a Cat. If you look at Zombies smashing turtle eggs. This just checks the mob griefing rule inside the goal itself. There's also a notion of "control flags" where you can enable/disable flags in the goal selector and match those against flags in the goal to see which can run. Never played with that, and it doesn't look widely used in vanilla? My question to you is how are you saving the config changed by the command? See the discussion on the other thread.
-
Just register a game rule and reference it in your AI. The game rule will handle saving it per world correctly and the command/permissions to change it. See here: https://forums.minecraftforge.net/topic/113444-storing-constant-data-in-a-json-file/#comment-504361
-
Mods not shown in the list, while in the mods folder.
warjort replied to BaguetteSloth's topic in Support & Bug Reports
My guess is you have a similar issue to the jar.zip problem mentioned here: https://forums.minecraftforge.net/topic/113483-mods-not-showing-up-in-game-119/#comment-504496 But you can't see the .zip part because you have extensions hidden in windows explorer?