Everything posted by warjort
-
I need to perform an action on an entity every 5 seconds
Don't expect us to write/design your mod for you. But the simplest way is to add some code to your entity's tick() method and then check the ticks @Override public void tick() { super.tick(); if (!this.level.isClientSide && this.tickCount % 100 == 0) { // 100 ticks = 20 * 5 = 5 seconds // do stuff } } You can use LivingTickEvent if it is not your entity. Or you can create your own tick/cooldown counter for your entity. e.g. look at "chargeTime" in the GhastShootFireballGoal for a vanilla example of a cooldown. There are many other examples in vanilla of varying complications, e.g. animal breeding, villager trading, etc. Finally, you can look on github at the source code for a mod that does something similar to what you are trying to do.
-
Getting a raw server IP address
I am not sure how to do that, but it will be something like (untested code): var packetListener = Minecraft.getInstance().getConnection(); if (packetListener != null && packetListener.getConnection().getRemoteAddress() instanceof InetSocketAddress inetSocketAddress) { System.out.println(inetSocketAddress); } Or there is also var packetListener = Minecraft.getInstance().getConnection(); if (packetListener != null) { System.out.println(packetListener.getServerData().ip); } But the latter is probably the "abcd.net"? If those don't give you what you want, you can use packetListener.getConnection().channel() to get the Netty implementation.
-
Create mod addon recipe issues (Forge 1.19.2 43.2.11)
This is the forge support forum. You want the create forum or discord.
-
Getting a raw server IP address
One other point: If you are planning to use this information to check against some kind of central database owned by you, you will need to get the user's permission to collect this information (even if it is anonymous). And you will need to treat any stored information with the same security that you would when storing a user's password.
-
Getting a raw server IP address
I believe getLocalIp() is just what is configured in the server.properties. It's likely the empty string unless the user has changed it? If you really want to know what addresses (it can be more than one) the server it is actually bound to, then you will have to do write some code to see what netty transport layer minecraft is using and then look at the Netty classes for each transport to get the information. But it might not be using a standard transport, e.g. a mod might have changed it: https://www.curseforge.com/minecraft/mc-mods/essential-mod Using an ip address is very brittle for your usecase anyway. Anybody can configure their server to have whatever ip address they want, then use NAT to translate to their real ip for external use. A MAC address would be better, but that can be spoofed too with more effort. public static void main(String[] args) throws Exception { // Standard java way to get the host ip System.out.println(InetAddress.getLocalHost().getHostAddress()); // Netty class to print the MAC address System.out.println(MacAddressUtil.formatAddress(MacAddressUtil.bestAvailableMac())); } None of this really has anything to do with Minecraft/Forge. You would be better off asking in the Netty forums or a general java or networking one.
-
[1.19.4] How can we disable rendering clouds in custom dimensions?
Javadoc of the event: https://github.com/MinecraftForge/MinecraftForge/blob/c8f9e59fef4c52875601014c9fa18e41be619d0f/src/main/java/net/minecraftforge/client/event/RegisterDimensionSpecialEffectsEvent.java#L24 Wiki docs for events in general: https://forge.gemwire.uk/wiki/Events Examples on github: https://github.com/search?q=RegisterDimensionSpecialEffectsEvent+language%3AJava&type=code&l=Java That took me 2 minutes to research. You can do the same. This is not a "learn modding" forum. And it is not way for you to use us a search engine. It is a support forum intended to provide help for modders that encounter real problems they don't understand after they have tried to figure it out for themselves. You spent maximum 16 minutes on this after my answer.
-
Error 1 1.19.2
https://forums.minecraftforge.net/topic/123416-exit-code-1/#comment-536369
-
1.19.4 Ticking entity Player (Resolved)
The error is caused by you using a mod for 1.19.3 with 1.19.4 Try the 1.19.4 beta version https://www.curseforge.com/minecraft/mc-mods/openblocks-elevator/files
-
Minecraft crash "Rendering overlay"
Broken config file. If you don't have a backup, delete the file and it will be recreated with default values.
-
[1.19.4] How can we disable rendering clouds in custom dimensions?
https://github.com/MinecraftForge/MinecraftForge/blob/1.19.x/src/main/java/net/minecraftforge/client/event/RegisterDimensionSpecialEffectsEvent.java
-
Forge server wont work
This thread is going around in circles. The solution is to find where you are passing this "-C:\Program, Files\Java\jdk-17\bin\java.exe" to the run.bat, it is NOT in the run.bat file. Compare the value from the error message and the one in the file. -C:\Program, Files\Java\jdk-17\bin\java.exe (error message) C:\Program Files\Java\jdk-17\bin\java.exe (run.bat) They are not the same. See the extra - and the , So the broken value is not coming from your run.bat This is the 3rd time I have tried to explain this. I am not going to do it again. If you can't figure it out, find somebody you know who understands computers to look at my answer and then check what you are doing.
-
Server start error
Please don't post text as images. jre1.8.0_351 is java 8 not java 18 You should use java 17 anyway.
-
Need help for my minecraft server
0.0.0.0 means you haven't configured the ip address, so it will bind to whatever ip address it finds on that machine. The client just says "connection refused". You need to contact hosterfy to resolve that error. It's a network issue, it's nothing to do with forge.
-
Need help for my minecraft server
The server is running. There is nothing in that log that says you are trying to connect. And that's still not the logs/debug.log Post the logs/debug.log from the client so we can see what that says. But it's likely some issue with the network, maybe the wrong ip address and port? That log says it is on port 60867 but doesn't say the ip address. You will probably need to contact hosterfy.
-
Need help for my minecraft server
Can you please stop posting logs in the forums. Use a file sharing site. And you need to post the logs/debug.log
-
The game crashed whilst unexpected error Error: java.lang.NoSuchMethodError: 'void net.minecraft.client.Options.load(boolean)'
Always check the mod you download (1.19.3) is compatible with the version of minecraft you are using (1.19.4) https://www.curseforge.com/minecraft/mc-mods/yungs-better-dungeons/files. And don't post on other people's threads unless you helping the original poster. START YOUR OWN THREAD.
-
Need help for my minecraft server
Looks like you are missing a mod. Maybe this one? https://www.curseforge.com/minecraft/mc-mods/incubation
-
My Astropolis Modpack world won't load anymore.
It's in your save, in the serverconfig subfolder.
-
My Astropolis Modpack world won't load anymore.
Broken config file. You can find it in the save/serverconfigs subfolder If you don't have a backup, you can delete the file and it will be recreated with default values.
-
Need help rendering a custom projectile
DO NOT post text as images. DO put ALL the relevant code on github so we can reproduce your problem. As for the little information you posted, you seem to be asking the same old FAQs answered many times before in this forum. This tells me you did little to no research for yourself. So I will spend about the same amount of time answering it. If this wasn't your first post, personally I would just have ignored this lazy incomplete question. For your main problem (sided success): https://forums.minecraftforge.net/topic/123627-solved-1182-levelexplode-doesnt-trigger-block-updates-correct-method-to-launch-player/?do=findComment&comment=537138 and you should register your renderer using this event: https://github.com/MinecraftForge/MinecraftForge/blob/c8f9e59fef4c52875601014c9fa18e41be619d0f/src/main/java/net/minecraftforge/client/event/EntityRenderersEvent.java#L93 not FMLClientSetUpEvent
-
I cant start my server
Unfortunately that says your level.dat is corrupted. You will need to restore your save from a backup. If you don't have proper backup, there might be a world\level.dat_old that minecraft makes when updating that file. Maybe that will work? But it does not do the same thing for other files in your save.
-
I cant start my server
Your problem is with optifine. It seems to think it is running inside vanilla instead of forge? But you shouldn't have optifine on a server anyway. It is a client side mod.
-
What am I doing wrong here with adding features to my biomes? (Minecraft 1.18.2) [solved]
https://misode.github.io/guides/feature-order-cycle/
-
forge 43.1.1 crashes even without mods
https://forums.minecraftforge.net/topic/123416-exit-code-1/#comment-536369
-
Minecraft crashed
https://www.curseforge.com/minecraft/mc-mods/framedblocks/files
IPS spam blocked by CleanTalk.