Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I made some flower blocks for my mod, i referenced vanila classes and created a StartupClientOnly class with help from this post1 and post2

StartupClientOnly:
https://pastebin.com/QQqDQcHT
Main Class:
https://pastebin.com/7NJChcMt

But the result is invisible blocks even though i set it to cut out.

 

The block i placed is the ZING_RED in the code. Tell me if you need to see model json files too!

image.png

Edited by starstorms21

It seems that your code is missing some things, maybe it is a copy-paste issue? For example the @Mod annotation on top of your main class or this line inside your client setup event:

RenderTypeLookup.setRenderLayer(RegistryHandler.ZING_RED.get(), RenderType.get());

which shouldn't even compile. Also it seems that your client event handler class is not subscribed to the event bus (@EventBusSubscriber)

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

  • Author

oh, ppft, yeah fixed, i was trying to change the RenderType to see if it works and forgot to change it back. Sorry

 

  • Author

i tried to register it with 
 

  MinecraftForge.EVENT_BUS.register(StartupMessageManager.class);

in main.....but before i did, my plants were just:
image.thumb.png.c544193be04bd748ca43cf1eddf16eed.png

how would i go about subscribing to the event?

 

Yeah, it subscribes the class, but that class does absolutely nothing in regard of your problem. You need to add the @EventBusSubscriber annotation on top of your startupclient class. That way every method in this class annotated with @SubscribeEvent will listen to the specified event

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

  • Author

tried:
@Mod.EventBusSubscriber(modid = "jsaga",bus = Mod.EventBusSubscriber.Bus.MOD,value = Dist.CLIENT)
@Mod.EventBusSubscriber(modid = "jsaga",bus = Mod.EventBusSubscriber.Bus.MOD)

 

but still invisible block...what a head scratcher

 

7 minutes ago, starstorms21 said:

tried:
@Mod.EventBusSubscriber(modid = "jsaga",bus = Mod.EventBusSubscriber.Bus.MOD,value = Dist.CLIENT)
@Mod.EventBusSubscriber(modid = "jsaga",bus = Mod.EventBusSubscriber.Bus.MOD)

 

but still invisible block...what a head scratcher

 

Just put one of them at a time of course (Maybe you already did, just for clarification)

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Post your updated code again please...however, it must be said..you can also register your class to the event bus without the annotation @EventBusSubscriber...similarly to what you were doing here:

MinecraftForge.EVENT_BUS.register(StartupMessageManager.class);

But with the line above you were registering the wrong class to the wrong event bus...you would need to use MOD_EVENT_BUS.register(StartupClientOnly.class) where MOD_EVENT_BUS is FMLJavaModLoadingContext.get().getModEventBus()

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

  • Author

Fixed the error, completely my mistake! I had set the block to render as invisible in the block class, im dumb. Thanks for your help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.