Everything posted by warjort
-
Held item not working unless switched off of
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.
-
How can i send message by my mode?
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);
-
How can i send message by my mode?
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
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"
-
Held item not working unless switched off of
We can let the original poster clarify what they really want, then continue this "tangent" if it is still relevant.
-
Held item not working unless switched off of
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.
-
invalid paths argument
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.
-
Held item not working unless switched off of
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
https://github.com/sp614x/optifine/issues/6974
-
[1.18.2] Method for iterating over blocks belonging to a tag
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)
-
Held item not working unless switched off of
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.
-
runClient in intelliJ using gradle gives error "Unrecognised option -p"; "Error: Could not create the Java Virtual Machine."
NOTE: If you are going to use java 18 for development, make sure you have something like the following in your build.gradle which will tell it to compile code for java 17 not 18 - you want users who only have java 17 to be able to run your code.
-
runClient in intelliJ using gradle gives error "Unrecognised option -p"; "Error: Could not create the Java Virtual Machine."
Yes Minecraft 1.18+ requires java 17+ https://docs.minecraftforge.net/en/1.18.x/gettingstarted/
-
1 Device not closed
https://github.com/sp614x/optifine/issues/6974
-
1.18.2 exit code -1
https://github.com/sp614x/optifine/issues/6974
-
[1.18.2] Detect entity collision detection with same type entities
Maybe Entity.push(Entity) is what you want?
-
Version 1.19-41.0.98 not installing due to javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException
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.
-
Hi!
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).
-
Hi!
biomesoplenty needs the terrablender mod installed
-
Version 1.19-41.0.98 not installing due to javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException
Probably because Oracle changed the license to their java runtime environment. It is no longer "free". Try https://adoptium.net/
-
Version 1.19-41.0.98 not installing due to javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException
You can't run minecraft 1.19 with java 8. Mojang's launcher comes with a more recent version of java. But when you run forge's installer that won't be used. It will use whatever you have installed manually and is configured on your PATH variable in your environment settings, in your case 1.8.0_31.
-
Version 1.19-41.0.98 not installing due to javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException
Your java is old. Update it to 1.17+
-
Change entity's AI goals dynamically
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.
-
Change entity's AI goals dynamically
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.
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?
IPS spam blocked by CleanTalk.