Jump to content

Llama_spit ignores this.doBlockCollision. (1.11)?


Recommended Posts

Posted

My entity goes through entities by using:

if (!this.worldObj.isRemote)
        {
            this.doBlockCollisions();
        }

 

So my question is.... why does this occur? This works for everything except for the llama_spit entity.

When using the execute command to execute a summon of the .doBlockCollision entity on it.

 

The spit juts forward and makes it look like the entity summoned at it is hitting a wall, only one is summoned then it falls down.

(Using repeat and always active.)

 

Is there any information in regards to this? Is this something being considered?

 

I'm not saying this is a bug, or its good. I haven't messed with it enough. ^-^;

 

 

 

 

Posted

Its also ignoring doBlockCollision when specified on impact, which is interesting. I need to look at the vanilla fireball.

 

public class EntityNetherOrb extends EntityOrb
{
public EntityNetherOrb(World worldIn)
    {
        super(worldIn);
    }
    public EntityNetherOrb(World worldIn, EntityLivingBase throwerIn)
    {
        super(worldIn, throwerIn);
    }
    public void onUpdate()
    {
    	super.onUpdate();
    	for (int j = 0; j < 1.4; ++j)
        {
    	this.worldObj.spawnParticle(EnumParticleTypes.DRAGON_BREATH, posX + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, posY + (worldObj.rand.nextFloat() / -1 - worldObj.rand.nextFloat()) / -1.9, posZ + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, 0, 0, 0);
        }
	this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, posX + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, posY + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, posZ + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / -7, 0, 0, 0);
	this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, posX + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, posY + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, posZ + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / -8, 0, 0, 0);
    }
    public float getGravityVelocity()
    {
        return 0.014F;
    }
    public EntityNetherOrb(World worldIn, double x, double y, double z)
    {
        super(worldIn, x, y, z);
    }
    protected void onImpact(RayTraceResult result)
    {
        if (result.entityHit != null)
        {
            int i = 0;
            if (ticksExisted >= 2.6210000524 && result.entityHit instanceof EntityLivingBase)
            {
                i = 8;
            }
            if (result.entityHit instanceof EntityLlamaSpit)
            {
            	this.doBlockCollisions();
            }
            result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)i);
            worldObj.playSound((EntityPlayer)null, posX, posY, posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.NEUTRAL, 0.5F, 1.9F / (worldObj.rand.nextFloat() * 0.4F + 0.8F));
        }
        for (int j = 0; j < 8; ++j)
        {
            this.worldObj.spawnParticle(EnumParticleTypes.SPELL_WITCH, this.posX, this.posY, this.posZ, 0.0D, 2.0D, 0.0D, new int[0]);
        }
        for (int j = 0; j < 2; ++j)
        {
        this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, this.posX + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, this.posY + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, this.posZ + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) / 2, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Block.getIdFromBlock(Blocks.PORTAL)});
        }
        ++ticksExisted;
        if (this.ticksExisted >= 100)
        {
        	this.setDead();
        }
        if (!this.worldObj.isRemote)
        {
            this.doBlockCollisions();
        }
    }
}

Posted

What are you actually trying to do? If you are trying to make your entity pass through other entities, that is NOT the correct way to do it. doBlockCollisions() calls Block#onEntityCollidedWithBlock() on any block the entity is colliding with, it has nothing to do with entity-entity collisions.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Try other builds of this modpack or report it to the modpack creator Looks like an issue with environmental, naturalist and/or crafttweaker
    • Hello! There is an issue with my world(Chocolate Edition modpack), after joining the world all creatures are frozen and the game is not responding or the game crashes after short period of time. Reproduction Steps: Turn on the game Join the world Game crashes immediately or after short period of time. Additional info: Crash log saying that an entity crashed the game is created after the crash(not the logs that I posted, different file from crash-logs, game crashed 3x by Snail, 1x by Small Snail, 1x by Tortoise) Specification: CPU: i5-13600KF GPU: GTX 1070 RAM: 32GB 3200MhZ - allocated 10GB Log links: latest.log: https://mclo.gs/Lp8zlsv crash-reports/crash: https://mclo.gs/XhtyJQI Minecraft version: 1.19.2 Modpack Version: Chocolate Edition 1.9 OS: Windows 10 Java Version: 22.0.2 Minecraft Java: Java 17
    • Hello, for several days I've been trying to find a way to add my animations in this style. @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { }   My current public class is : public class FakePlayerModelWithAnim<T extends FakePlayerEntity> extends EntityModel<EntityRenderState>   But i can't do that :  public class FakePlayerModelWithAnim<T extends FakePlayerEntity> extends EntityModel<T> Type parameter 'T' is not within its bound; should extend 'net.minecraft.client.renderer.entity.state.EntityRenderState' But with EntityRenderState it ok and it work !   But my setupAnim look like this :  @Override public void setupAnim(EntityRenderState p_370046_) { super.setupAnim(p_370046_); }   I don't have any access to my entity ! Look like 1.21.1 : @Override public void setupAnim(FakePlayerEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); this.applyHeadRotation(netHeadYaw, headPitch); this.animateWalk(FakePlayerEntityAnimations.ANIM_PLAYERS_WALKING, limbSwing, limbSwingAmount, 2f, 2.5f); this.animate(entity.idleAnimationState, FakePlayerEntityAnimations.ANIM_PLAYERS_IDLE, ageInTicks, 1f); } But i'm stuck with new version of Forge...
    • Looks like an issue with abyssalsovereigns - this mod has functions that are not working on a server (client-side-only mod)
    • I added some new mods and updated old ones to my forge server and they will run successfully but the moment I try to join ill briefly load into the world and get booted with the message, internal server error. The mods in question work fine on singleplayer and removing too many from the server causes it to stop working so I cant be sure which one is causing the problem... any ideas? server log: https://pastebin.com/hGH8UUjm client log (from modrinth app): https://mclo.gs/a3oOUGY
  • Topics

×
×
  • Create New...

Important Information

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