Everything posted by Tryhard
-
How to spawn lightning with forge 1.14
-
How to spawn lightning with forge 1.14
-
How to spawn lightning with forge 1.14
Well, just like the title says, i'm having trouble spawning a new lightning into the world. How about a little bit of background first. I'm new to modding, and i really REALLY want to get into it. I already know Java and object oriented programming, not on an expert lvl but i do think i'm ready for this. The main difficulty for me is, understanding how minecraft works, and what each class and methods do... i still fail to grasp the uses for ItemStack, BlockStates, DataTables, ItemGroups, ItemProperties etc... I am currently trying to understand events, since they seem to be quite simple. With that said, i am messing around with a simple idea involving mouse input events. An item that summons lightning... after a short while of researching this topic, i realized this is quite the common idea among new modders. Anyway, i'm just trying to get anything to do something ingame, the code will NOT be the best, i do hope to get some informative feedback from u guys So far i managed to get a custom item into the game (by following a tutorial on youtube, not a very good one, "just do what i do" type of tutorial, so i still don't understand the entirety of the process of adding blocks/items). NOTE: The original idea was to summon lightning wherever the player was looking at the moment of swinging said item. But since i just can't manage to get the target block, i decided to sumon lightning when and where a block is broken by said item. So i added an event listener to this item (inside the class itself) and linked it to the porper event bus. The problem is, it "kinda" works. What i mean by that is, the lightning strike does happen, but the actual "beam" doesn't show up. I don't really know how to attach code in here but, eh, here it goes: public class TutorialItem extends Item { public static final String REGISTRY_NAME = "tutorial_item"; public static final String DISPLAY_NAME = "Tutorial Item"; public TutorialItem(){ super(new Item.Properties().maxStackSize(2).group(ModSetup.itemGroup)); MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void summonLightning(InputEvent.MouseInputEvent event){ //nothing here yet } @SubscribeEvent public void test(BlockEvent.BreakEvent event){ World world = (World)event.getWorld(); BlockPos pos = event.getPos(); Iterable<ItemStack> items = event.getPlayer().getHeldEquipment(); Iterator<ItemStack> it = items.iterator(); Item item; Boolean playerHasItem = false; while(it.hasNext()){ item = it.next().getItem(); if(item instanceof TutorialItem){ System.out.println("ITEM: " +this.DISPLAY_NAME); playerHasItem = true; break; } } if(playerHasItem) { LightningBoltEntity new_lightning = new LightningBoltEntity(world, pos.getX(), pos.getY(), pos.getZ(), false); new_lightning.setLocationAndAngles(pos.getX(), pos.getY(), pos.getZ(), 0, 0.0F); world.addEntity(new_lightning); } } } I'm sure i do NOT need to loop through that "items" collection thingy... bu i just don't know how to handle that Object. Then, when i am spawning the lightning, i saw that for older versions they used the methods World#addWeatherEffect and World#spawnInWorld, but they are nowhere to be found now, i'm sure i'm just not spawning that lightningbolt correctly.
-
gradle runClient task fails, sounds.json related error
I've given up on that first try, mess of a mod. This afternoon i started over, following Cabidoodev's tutorial. Everything went okay but, his tutorial is not finished is it? I got to "first item" section.
-
gradle runClient task fails, sounds.json related error
yeah i guess it isn't sorry for that haha, never actually used it before, i only wanted to put it all there for you to see
-
gradle runClient task fails, sounds.json related error
I managed to upload it, here's the link.
-
gradle runClient task fails, sounds.json related error
Oh, and i've been looking at the tutorial you mentioned, and, is the build.gradle configuration completely necessary?
-
gradle runClient task fails, sounds.json related error
Been trying to upload it as a repo, but it won't allow me to upload anything heavier than 25mb, the project folder is currently about 50mb.
-
gradle runClient task fails, sounds.json related error
Yes about that line... i don't think it is complaining about the mod id, is it? i mean, my mod id is unique, and all in lower case "testmodd". I mean, yes, i got it wrong the first time, but as i stated on my original post, i changed it. But now, i find that line quite confusing It confuses me because that file, the sounds.json i havent event created it, and if it already exists, i haven't modified it at all. And also, it seems like the "incorrect" character is in the namespace TestMod, which i also don't understand hahah
-
gradle runClient task fails, sounds.json related error
Yes, i completely agree with the "do what i do" thing. You see, this is about the only half good tutorial i could find, of version 1.13 / 14. I am definitely checking out this other tutorial you posted, thank you. But anyway, back to my issue, by looking at the crash report, do you know what could be wrong here?
-
gradle runClient task fails, sounds.json related error
So, i am currently trying to get myself started in the world of minecraft modding. To do so, i am following this modding tutorial on youtube -> www.youtube.com / watch?v=YRCtFeECB8M I do have java knowledge, so i thought creating a mod for minecraft wouldn't be all that difficult... oh boy was i wrong.... anyway, so fa i've managed to setup my workspace, and run my client ONCE. The first time i tried to run gradle runClient, it crashed, by following the crash report, i understood that i had used an invalid MOD_ID, changed it, tried again, and it worked, all good. After that i continued with the tutorial, then, after a while i tried to run the command again. This time it failed, just like the first time, i head over to the crash reports folder, to check it out. This time around though, i am completely unable to understand the error.... well, i do understand that i have an invalid character around the "namespace of sounds.json".. a file that i haven't even created yet... and it didn't complain the first time i run the command. Anyway, this is the crash report: ---- Minecraft Crash Report ---- // Hi. I'm Minecraft, and I'm a crashaholic. Time: 28/06/19 01:35 Description: Initializing game net.minecraft.util.ResourceLocationException: Non [a-z0-9_.-] character in namespace of location: TestMod:sounds.json at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:28) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:accesstransformer:B,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:41) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:accesstransformer:B,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraft.client.audio.SoundHandler.onResourceManagerReload(SoundHandler.java:70) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraft.resources.SimpleReloadableResourceManager.addReloadListener(SimpleReloadableResourceManager.java:114) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.init(Minecraft.java:466) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:accesstransformer:B,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:385) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:accesstransformer:B,pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:117) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {pl:object_holder_definalize:A,pl:runtime_enum_extender:A,pl:capability_inject_definalize:A,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) [modlauncher-2.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32) [modlauncher-2.1.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) [modlauncher-2.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:59) [modlauncher-2.1.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:44) [modlauncher-2.1.1.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98) [forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:28) at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:41) at net.minecraft.client.audio.SoundHandler.onResourceManagerReload(SoundHandler.java:70) at net.minecraft.resources.SimpleReloadableResourceManager.addReloadListener(SimpleReloadableResourceManager.java:114) at net.minecraft.client.Minecraft.init(Minecraft.java:466) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:385) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32) at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) at cpw.mods.modlauncher.Launcher.run(Launcher.java:59) at cpw.mods.modlauncher.Launcher.main(Launcher.java:44) at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98) -- System Details -- Details: Minecraft Version: 1.13.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_211, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 292108992 bytes (278 MB) / 867696640 bytes (827 MB) up to 1908932608 bytes (1820 MB) JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2048m FML: New FML! Loaded coremods (and transformers): Nothing Launched Version: MOD_DEV LWJGL: 3.1.6 build 14 OpenGL: Intel(R) HD Graphics 620 GL version 4.4.0 - Build 21.20.16.4534, Intel GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'forge' Type: Client (map_client.txt) Resource Packs: Current Language: English (US) Profiler Position: N/A (disabled) CPU: 4x Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz I am new here, and i don't really know how to properly attach code on this post, so i'm just uploading the files. The main class of the mod, the itemList and a class i named Reference, which simply contains the basic configuration of the mod, if you need anything else, just let me know. PLS help this thing is reeeally getting me on my nerves TestMod.java Reference.java ItemList.java
IPS spam blocked by CleanTalk.