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

Does anyone have experience working with SpriteRenderer? I've been looking around everywhere for the past few hours on how I could render my item similarly to how snowballs/ender pearls/fireballs do, and I've gotten nowhere. Any help would be greatly appreciated!

 

Entity class: https://pastebin.com/LkZE1qLU

 

Renderer:
public class PancakeProjectileRender extends SpriteRenderer<PancakeProjectile> {
    public PancakeProjectileRender(EntityRendererManager renderManagerIn) {
        super(renderManagerIn, Minecraft.getInstance().getItemRenderer());
    }
}


Registration:

RenderingRegistry.registerEntityRenderingHandler(ModEntities.pancakeProjectileEntity, PancakeProjectileRender::new);

 

Using the above, I can confirm the registration runs (I have it run during the FMLClientSetupEvent), but the entity isn't visible in the world. I can confirm that the entity itself works, as it's still able to move and kill entities, just that it doesn't show a hitbox in F3+B and it doesn't render a texture.

Edited by hammy3502

You need to override createSpawnPacket in your entity class. Look at this guide for reference: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe81_entity_projectile

Also, why did you put this above your entity class?

@OnlyIn(
        value = Dist.CLIENT,
        _interface = IRendersAsItem.class
)

 

Edited by Beethoven92

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

  • Author

Hello, and thank you for the help!

 

The overriding of createSpawnPacket didn't seem to work, though thank you for catching it before it didn't work in multiplayer!

 

Although I'm using the constructor that actually takes in a shooter (I'm having another item spawn the projectile using it), Forge seems to try to spawn it using the FMLPlayMessages.SpawnEntity spawnEntity, World world constructor, where I can't seem to find the shooter, leading me to believe it had been lost. Would there be any way to recover it, and transfer any other data along with it?

  • Author

The repo is currently a bit of a mess, as I'm currently porting over from 1.12 before I focus on cleaning up with how different 1.16 is in comparison 1.12.

  • Author

Going to open up another thread about the issue I've run into, since the title no longer fits this one

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.