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 am making NPCs, and since it would be cool to have universal renderer I'd like to make rendering entity-sensitive.

 

What was in my mind:

public class EntityNPC extends EntityLiving
{
private String model = "biped";
private String texture = "steve";
....

 

So basically I am looking for a good way to make server TELL client what model/renderer/texture should this particular entity choose.

Goal:

Accept ANY registered renderer, any resource and model. (in case that client cant find it - render Biped steve)

 

I am still looking at code, so any info/ideas would be nice.

What bothers me is that each Entity.class has it's own STATIC renderer. So what I would have to do is actually override EVERYTHING from the most basic level - that is Render.class to make all methods actually read my entity.

 

Questions:

- How to get all models registered on client?

- How much does server know? I will probably have to use reference HashMaps that will be read with packet.

 

Just to clarify:

I spawn NPC:  /npc create render:dragon texture:reddragon

Entity on client side obviously receives packet with some string values like "render:dragon" and "texture:reddragon"

and my renderer tries to make this entity be rendered using RenderDragon.class with texture (Render.getEntityTexture(Entity entity))

also provided.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

I got some idea by looking at IChun's Morph mod, and I decided to only make good preparations (abstractions) for future (since I have lot of other more important things to code).

 

Interesting resources:

Citizens2 - allows to make e.g sheep NPCs.

IChun's Morph - make "wtf" models for entities.

 

Problem postponed.

1.7.10 is no longer supported by forge, you are on your own.

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.