Jump to content

warjort

Members
  • Posts

    5420
  • Joined

  • Last visited

  • Days Won

    175

Everything posted by warjort

  1. 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.
  2. 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);
  3. 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 ๐Ÿ™‚
  4. 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"
  5. We can let the original poster clarify what they really want, then continue this "tangent" if it is still relevant.
  6. 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.
  7. 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.
  8. 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.
  9. https://github.com/sp614x/optifine/issues/6974
  10. 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)
  11. 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.
  12. 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.
  13. Yes Minecraft 1.18+ requires java 17+ https://docs.minecraftforge.net/en/1.18.x/gettingstarted/
  14. https://github.com/sp614x/optifine/issues/6974
  15. https://github.com/sp614x/optifine/issues/6974
  16. Maybe Entity.push(Entity) is what you want?
  17. 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.
  18. 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).
  19. biomesoplenty needs the terrablender mod installed
  20. Probably because Oracle changed the license to their java runtime environment. It is no longer "free". Try https://adoptium.net/
  21. 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.
  22. 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.
  23. 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
  24. 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?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.