Jump to content

Recommended Posts

Posted

Hello everybody! First of all sorry for my bad English, I'm from Spain :(.

Could You help me? I'm learning how to make mods with forge.  I'm creating a mod called "Olives" (Yes, it's weird). Now, I want to create a custom tree that spawns in certain biomes like Forests and Plains. The point is that I don't know how to make the necessary code. I'm very disappointed because I can't find any tutorial for 1.5 about it. Sorry again for my bad English :-[;D.Tell me if you need some more information.

Posted

Never tried creating Trees/Biomes etc so can't help you there but what I will say is find a tutorial for 1.4.7 or closest to, follow it then when you hit errors you can post specific questions based upon the errors found. 1.5 couldn't of broken it too much so I'm sure the underlining system are still pretty much the same.

Posted

Hello and thank you for comment. I will do as you said and if I get errors I'll put them here. Now only remains to find a good tutorial. Thank you again ;D

 

 

Modif: I have tried a 1.4.7 tutorial, but it has not worked. Do not know of any tutorial for 1.4.7 or 1.5? Please :(. Thanks!

Posted

Hello! TheGrovesyProject101 thank you very much but I still can not make it work. I followed the tutorials but my tree is not generated in the world (I've been exploring a lot but I didn't find it). The matter is that code does not give me any error...Thanks anyway. :)

Posted

The fact that the code ain't giving an error means that the code's syntax is valid. Not that it will do as you intended.

When it get's errors before you run it, the errors are with the syntax or grammar of your code if you will.

When it crashes at runtime it encounters something it didn't know how to handle, like nothing where it expected something(Null pointer exception).

 

But when it does neither and does not produce the wanted result, the code is still wrong. It's just allowed to type it out that way you did so you get no pre-compile errors :P

 

If you want help tough, post your mainmod file at pastbin.com (USE JAVA SYNTAX HIGHLIGHTNING!!!) and give us the link.

Also include code for blocks and the generation files etc.

 

Then we can help you figure out where your problem is located so you can fix it.

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

Hello! Here are all the mod files:

 

 

MainClass:

 

http://pastebin.com/bWYR3W8f

 

Olive:

 

http://pastebin.com/AJ6CQHJp

 

OliveBlock:

 

http://pastebin.com/2reVmetE

 

TutLeaf:

 

http://pastebin.com/cZFc570y

 

TutLog:

 

http://pastebin.com/qFLYJ41x

 

TutSapling:

 

http://pastebin.com/XpmzRZMp

 

TutWorldGen:

 

http://pastebin.com/R8BqFVg9

 

WorldGenTutTree:

 

http://pastebin.com/yc0My0cd

 

 

 

When I solve the error I will change the names of the class files. Thank you :)

 

 

Posted

put this in the load method

GameRegistry.registerWorldGenerator(new TutWorldGen());

and put @Init above the load method. It should look like this

@Init
public void load ()

and get rid of the extra set of {} that comess right after the load method on the same line

Posted

Hello and tank you soooo much :D. My trees generates normaly without errors, but How can I use bonemeal with my custom sapling? I tried to put some bonemeal on but it doesn't work. Finally, using the tutorial from TheGrovesyProject101, How can I put the textures? Sorry but it is my first time creating a custom tree :-[. Thank you :D!!

Posted

You should go check out this page!

It should give you some better understanding of the @Init and @Mod annotations as well as help you get your textures and blocks working.

For information on Textures and Icons as of 1.5.X read AtomicStryker's post about it :)

 

As for Bonemeal to work, I believe that one is quite easy to fix but did you try something from a tutorial which didn't work or did I misunderstand your post? :)

If the tutorial code didn't work for you then share your code for the sappling and whatever you modified to get the bonemeal to work. (like your mainMod file).

 

  Quote

If you guys dont get it.. then well ya.. try harder...

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Make a test with another Launcher like the Curseforge Launcher, MultiMC or AT Launcher
    • can anyone help me i am opening forge and add modpacks and then it says unable to update native luancher and i redownlaod java and the luancher it self?
    • The problem occurs also in 1.20.1 Forge, but with an "Error executing task on client" instead. I have "Sinytra Connector" installed. On 1.21.5 Fabric, there is no problem. When this happens, the chat message before the death screen appears gets sent, with an extra dash added.
    • Well, as usual, it was user error. Naming mismatch in sounds.json.  Please delete this post if you find it necessary. 
    • Hello Forge community.  I'm running into an issue with a mod I'm working on.  To preface, I can call /playsound modId:name music @a and I can hear the sound I registered being played in game. Great!  However, I cannot get it to trigger via my mod code.    Registration: public static final RegistryObject<SoundEvent> A_WORLD_OF_MADNESS = SOUND_EVENTS.register("a_world_of_madness", () -> new SoundEvent(new ResourceLocation("tetheredsouls", "a_world_of_madness")));   Playback: Minecraft mc = Minecraft.getInstance(); if (!(mc.player instanceof LocalPlayer) || mc.level == null) return; LocalPlayer player = (LocalPlayer) mc.player; BlockPos pos = player.blockPosition(); SoundEvent track = ModSounds.A_WORLD_OF_MADNESS.get(); System.out.println(track); System.out.println(pos); System.out.println(player); // play exactly like the tutorial: client-only, at the player's position try { mc.level.playLocalSound( player.getX(), player.getY(), player.getZ(), track, SoundSource.MUSIC, // Or MASTER if needed 1f, 1f, false ); System.out.println("[DEBUG] playSound success: " + track.getLocation()); } catch (Exception e) { System.err.println("[ERROR] Failed to play sound: " + track.getLocation()); e.printStackTrace(); } Sounds.json:   { "theme_of_laura": { "category": "music", "sounds": [ { "name": "tetheredsouls:a_world_of_madness", "stream": true } ] } } Things I have tried: - multiple .ogg files. Short .ogg files (5 seconds, <100KB).  - default minecraft sounds imported from import net.minecraft.sounds.SoundEvents; These work given my code. No idea why these are different.  - playSound() method, as well as several others in past iterations that did not work   I would be forever grateful if somebody could point me in the right direction. I've looked at several mod github repositories and found extremely similar code to what I'm doing. I've also found several threads in this forum that did not solve my issue. I just cannot figure out what I'm doing differently, and why I'm able to queue sounds manually with playsound but the code won't play it (despite confirming the code is being run with the debug statements.)
  • Topics

×
×
  • Create New...

Important Information

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