Jump to content

Entity randomness


thebest108

Recommended Posts

I have a simple non living entity, but it randomly goes up or down making the player standing on it fall

Does anyone know a fix for this?

I have the same issue with an entity which is just a copy of the Painting.

 

Can I see the code of your Entity registration with the EntityRegistry?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

alright

Im registering it with

EntityRegistry.registerModEntity(DerpEntity.class, "EntityDerp", 1, this, 128, 1, true);


THIS IS THE ENTITY CLASS

public DerpEntity(World par1World) {
	super(par1World);
	this.setSize(1.0F, 1.0F);
        this.entityCollisionReduction = 1.0F;
        this.renderDistanceWeight = (double)(1);
        this.texture = "textures/blocks/dirt";
}
@SideOnly(Side.CLIENT)
    public float getShadowSize()
    {
        return 1.0F;
    }	
@Override
public AxisAlignedBB getBoundingBox(){
	return this.boundingBox;
}
@Override
 public boolean canBePushed()
    {
        return false;
    }
@Override
 public AxisAlignedBB getCollisionBox(Entity var1){
	return this.getBoundingBox();
}
public void onUpdate()
{
     }
@Override
public boolean canBeCollidedWith()
    {
        return true;
    }
@Override
protected void entityInit() {
        this.dataWatcher.addObject(27, this.entityId);
}

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

Link to comment
Share on other sites

Anyone have a solution?

 

You can either heighten the 2nd last parameter or set the last one to false in your registerModEntity and see if that works.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I have implemented custom painting, but it's kinda old code. I think I fixed same issue as you're describing. My registration code:

registerEntity(EntityJaffaPainting.class, "jaffaPainting", 160, Integer.MAX_VALUE, false, JaffaPaintingEntityID);

    private void registerEntity(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, int id) {
        EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
        EntityRegistry.registerModEntity(entityClass, entityName, id, this, trackingRange, updateFrequency, sendsVelocityUpdates);
    }

 

Not sure if it helps, but it's better than nothing :D.

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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