
Thornack
Members-
Posts
629 -
Joined
-
Last visited
Everything posted by Thornack
-
[1.7.10] How to render Mob HP Bar above Mob's position?
Thornack replied to Thornack's topic in Modder Support
I looked at RenderSnowball class but im not sure what section is relevant to what I have to do. -
Hi everyone, So I am trying to render a mobs HP in a bar above its position if the mob is in a battle with a player (I use a string to control the triggering of the render) basically if the string contains the characters "Fighting:" then the hp bar should render above the mob. So far I tried the following (which is kinda cool but not what I want) (the code below changes the colour of the mob from green to yellow to orange to red as the mob takes damage (I want my health bar to do the same aswell). Im not really experienced with this sort of thing so the code below is code that I created for rendering and Hp bar for the player in his HUD: Im using this as a basis to go off of. Any help / suggestions on what to do next are appreciated. My Renderer Class @SideOnly(Side.CLIENT) public class RenderCustomEntity extends RenderLiving // if I extend RendererLivingEntity the Exp bar always renders and we don't want this { private ModelBase playerModel = new ModelBiped(); private ModelBase consistentModel; // private GameProfile gameProfile = null; private ResourceLocation consistentTexture; private ResourceLocation currentTexture; private Minecraft mc = Minecraft.getMinecraft(); public RenderCustomEntity(ModelBase model, String textureName, float shadowRadius) { super(model, shadowRadius); this.consistentTexture = new ResourceLocation("customMod:textures/mob/" + textureName); this.consistentModel = model; } private static final ResourceLocation healthBarTexture = new ResourceLocation("customMod:textures/gui/HealthBar.png"); @Override public void doRender(Entity entity, double x, double y, double z, float f, float F) { if (entity instanceof EntityCustomEntity) { EntityCustomEntity customEntity= (EntityCustomEntity) entity; if(customEntity.inBattle != null && customEntity.inBattle.contains("Fighting:")){ int currentHp = customEntity.stats.currentHp; int maxHp = customEntity.stats.hp; int width = mc.displayWidth; int height = mc.displayHeight; this.mc.getTextureManager().bindTexture(healthBarTexture); int healthBarWidth = (int)(((float) currentHp/ maxHp) * 71); drawTexturedModalRect(width/2 -106, height- 40, 0, 0, 77, 9); int xOffset = 0; if(currentHp >=100){ xOffset = -6; } if(healthBarWidth > 30){ drawTexturedModalRect(width/2 -106 + 2, height- 40 + 1, 0, 9, healthBarWidth, 5); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -91 + xOffset, height- 49, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -89 + xOffset, height- 49, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 50, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 48, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 49, 56576); } else if(healthBarWidth <= 30 && healthBarWidth >10 ){ drawTexturedModalRect(width/2 -106 + 2, height- 40 + 1, 0, 14, healthBarWidth, 5); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -91 + xOffset, height- 49, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -89 + xOffset, height- 49, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 50, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 48, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 49, 15064320); }else if(healthBarWidth <=10){ drawTexturedModalRect(width/2 -106 + 2, height- 40 + 1, 0, 19, healthBarWidth, 5); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -91 + xOffset, height- 49, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -89 + xOffset, height- 49, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 50, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 48, 0); this.mc.fontRenderer.drawString("HP: " + (int)this.mc.thePlayer.getHealth() + "/" + currentHp, width/2 -90 + xOffset, height- 49, 15015936); } } String ownerName = customEntity.getEntityIsMorphedToPlayer(); if (ownerName != null && !ownerName .equals("")) { this.currentTexture = AbstractClientPlayer.locationStevePng; this.mainModel = this.playerModel; } else { this.currentTexture = this.consistentTexture; this.mainModel = this.consistentModel; } } super.doRender(entity, x, y, z, f, F); } protected ResourceLocation getEntityTexture(Entity entity) { return this.currentTexture; } protected float zLevel; public void drawTexturedModalRect(int x, int y, int u, int v, int rectWidth, int rectHeight) { float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)(x + 0), (double)(y + rectHeight), (double)this.zLevel, (double)((float)(u + 0) * f), (double)((float)(v + rectHeight) * f1)); tessellator.addVertexWithUV((double)(x + rectWidth), (double)(y + rectHeight), (double)this.zLevel, (double)((float)(u + rectWidth) * f), (double)((float)(v + rectHeight) * f1)); tessellator.addVertexWithUV((double)(x + rectWidth), (double)(y + 0), (double)this.zLevel, (double)((float)(u + rectWidth) * f), (double)((float)(v + 0) * f1)); tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)this.zLevel, (double)((float)(u + 0) * f), (double)((float)(v + 0) * f1)); tessellator.draw(); } }
-
[1.7.10] RenderPlayerPre Event - How to smooth out model jitter
Thornack replied to Thornack's topic in Modder Support
I solved it, this is the math and yes its sucky //Actual entity position equation is actualPos = lastTickPos + (currentTicPos - lastTickPos) * partialTicks - Thanks to diesieben07 for this //But you have to calculate the lastTicPos and currentTicPos based on the past/present positions of the two players to put the model in the right spot double x = (pre.entityPlayer.prevPosX - thePlayer.prevPosX) + ((pre.entityPlayer.posX - thePlayer.posX) - (pre.entityPlayer.prevPosX - thePlayer.prevPosX))*pre.partialRenderTick; double y = (pre.entityPlayer.prevPosY - thePlayer.prevPosY) + ((pre.entityPlayer.posY - thePlayer.posY) - (pre.entityPlayer.prevPosY - thePlayer.prevPosY))*pre.partialRenderTick; double z = (pre.entityPlayer.prevPosZ - thePlayer.prevPosZ) + ((pre.entityPlayer.posZ - thePlayer.posZ) - (pre.entityPlayer.prevPosZ - thePlayer.prevPosZ))*pre.partialRenderTick; -
Hi everyone, I have a mod where the player can morph into entities that he "owns". He can call upon them whenever and all that. i do have an issue however in multiplayer. The models seem to "jitter" when a second player logs in and sees the morphed player (his new model shows up) but it jitters which is odd. I was wondering if there is any way to smooth out this jitter. here is my event @SubscribeEvent public void onRenderPlayerPre(RenderPlayerEvent.Pre pre) { BattlePlayerProperties bpp = BattlePlayerProperties.get(pre.entityPlayer); // Client Side Player if (bpp == null) { return; } if(bpp.isMorphed()) { pre.setCanceled(true); // this stops the player from rendering EntityPlayer thePlayer = Minecraft.getMinecraft().thePlayer; float modelYOffset; if(pre.entityPlayer.equals(thePlayer)){ modelYOffset = -1.625F; } else{ modelYOffset = 0F; } int modelId = bpp.getModelId(); //default is -1 which is steve model double x = pre.entityPlayer.posX - thePlayer.posX; double y = pre.entityPlayer.posY - thePlayer.posY; double z = pre.entityPlayer.posZ - thePlayer.posZ; Render renderPlayerModel = PlayerRenderingRegistry.getRendererByModelId(modelId); renderPlayerMode.doRender(pre.entityPlayer, x, y + modelYOffset, z, 0F, 0.0625F); } } it seems the issue has to do with the x, y, and z x coordinates that I calculate so that the new model renders in the correct spot for the player. Any ideas how to fix the jitter? it only seems to happen when the second player sees the morphed player and this second player moves around while the morphed player is stationary. I think it may also be happening when the morphed player moves around but it isn't as noticeable I don't think.
-
This happens when I run a dedicated server, join the world, then store an entity inside my itemstack using my item and pick up the resultant item containing the nbt data for my entity "too fast" it seems (although it doesnt happen every time which is odd) Anyone know why this would occur? [13:57:03] [Netty IO #2/ERROR] [FML]: NetworkDispatcher exception io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:129) ~[MessageToByteEncoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637) ~[DefaultChannelHandlerContext.class:?] at cpw.mods.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:423) ~[NetworkDispatcher.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:688) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:717) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:893) ~[DefaultChannelPipeline.class:?] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:239) ~[AbstractChannel.class:?] at net.minecraft.network.NetworkManager$1.run(NetworkManager.java:197) [NetworkManager$1.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:?] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348) [NioEventLoop.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?] at java.lang.Thread.run(Unknown Source) [?:1.7.0_25] Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) ~[?:1.7.0_25] at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.7.0_25] at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:33) ~[NBTTagCompound.class:?] at net.minecraft.nbt.CompressedStreamTools.func_150663_a(CompressedStreamTools.java:158) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.write(CompressedStreamTools.java:148) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.compress(CompressedStreamTools.java:88) ~[CompressedStreamTools.class:?] at net.minecraft.network.PacketBuffer.writeNBTTagCompoundToBuffer(PacketBuffer.java:94) ~[PacketBuffer.class:?] at net.minecraft.network.PacketBuffer.writeItemStackToBuffer(PacketBuffer.java:140) ~[PacketBuffer.class:?] at net.minecraft.entity.DataWatcher.writeWatchableObjectToPacketBuffer(DataWatcher.java:289) ~[DataWatcher.class:?] at net.minecraft.entity.DataWatcher.writeWatchedListToPacketBuffer(DataWatcher.java:186) ~[DataWatcher.class:?] at net.minecraft.network.play.server.S1CPacketEntityMetadata.writePacketData(S1CPacketEntityMetadata.java:50) ~[s1CPacketEntityMetadata.class:?] at net.minecraft.util.MessageSerializer.encode(MessageSerializer.java:46) ~[MessageSerializer.class:?] at net.minecraft.util.MessageSerializer.encode(MessageSerializer.java:53) ~[MessageSerializer.class:?] at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:111) ~[MessageToByteEncoder.class:?] ... 15 more [13:57:03] [server thread/INFO]: Player14 lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null}} [13:57:03] [server thread/INFO]: Player14 left the game
-
So it seems that for mobs the throwable heading is incorrect if you calculate it the way that EntityThrowable calculates it. The way around this was to instead use the entitites look vector.x (y and z) coordinates inside the setThrowableHeading method to calculate the correct heading after you create an instance of your EntityThrowable. EntityRangedAttackBase distanceAttack = new EntityRangedAttack(world, entityUsingAttackItem).setType(attackType).setAreaOfEffectRadius(damageRadius); distanceAttack.setBaseDamageForProjectileAttack(baseDmg); distanceAttack.setThrowableHeading(entityUsingAttackItem.getLookVec().xCoord, entityUsingAttackItem.getLookVec().yCoord + 0.1, entityUsingAttackItem.getLookVec().zCoord, 1.5F, 1.0F);
-
Hi Everyone, So I have been developing a system where I have items that launch projectiles. I want these items to work for both the player and mobs. They work perfectly fine for the player atm but for the mob the projectiles are launched at the incorrect lookvector. I noticed that the client and server values for the look vector are not in sync. How does minecraft sync them up?
-
[1.7.10] How to get the lastAttackingEntity inside an AI
Thornack replied to Thornack's topic in Modder Support
I use the LivingHurtEvent to set the last attacker and then I just get the attacker in my AI and it works @SubscribeEvent public void hurt(LivingHurtEvent event) { if(event.entity instanceof EntityCustom){ EntityCustom entity = (EntityCustom) event.entity; entity.setLastAttacker(event.source.getEntity()); } } now it isnt null public boolean shouldExecute() { System.out.println("ATTACKING ENTITY IS: " + this.taskOwner.getLastAttacker()); } -
Hi everyone, I am working on a targeting AI, it is basically identical atm to the skeleton targeting AI as I have just started and I got this to work for my entity all of the methods are called properly etc etc. I was wondering if anyone would know how I could get the last attackerEntity that attacked the entity doing the targeting? I basically want to use this to change the targeting code so that instead of doing the regular targeting code that a skeleton does, my ai will do revenge attacks on the last attacking entity inside the shouldExecute method? I have tried outprinting the following to see whether or not i could get the entity using getLastAttacker(); System.out.println("LAST ENTITY TO ATTACK ME WAS: " + this.taskOwner.getLastAttacker()); but I get null every tick. anyone know why?
-
[1.7.10] onItemRightClick Spawn based on ray trace
Thornack replied to Thornack's topic in Modder Support
I have been looking at it but when I try to use their method i cannot achieve what i want since the movingObjectPosition is null when you aim into the sky and I want my mob to spawn regardless of where you point the mouse (at a set radius) and if you point it on the ground it spawns just above the block you pointed at. -
[1.7.10] onItemRightClick Spawn based on ray trace
Thornack replied to Thornack's topic in Modder Support
My thoughts were to use my IEEP class for my player so that I can simply grab the values from the ray trace send them to the IEEP class on server side and then access the IEEP class from server side in the onItemRightClick method to use them for my spawning coordinates but I feel like there is a better way to achieve this since my rayTrace would happen in the onItemRightClick method -
Hi everyone, I have an item that stores an entity. I want this item to spawn the entity a given distance away from wherever the player right clicked the item based on a raytrace. I now have an issue if (world.isRemote){ MovingObjectPosition mop = player.rayTrace(5, 1.0F); int xCoord; int yCoord; int zCoord; if (!world.isAirBlock(mop.blockX, mop.blockY, mop.blockZ)){ xCoord = mop.blockX; yCoord= mop.blockY + 1; zCoord = mop.blockZ; } else { xCoord = mop.blockX; yCoord= mop.blockY; zCoord = mop.blockZ; } //send the packet here to update the server values so that I can then spawn my entity at a later time in the code } The ray trace has to occur client side but I need the results of the ray trace on server side. How would you suggest the packet to work so that I can pass the values from the client player to the server so that they can be used to spawn the entity? public class PacketC2SUpdateRayTraceCoords extends AbstractMessageToServer<PacketC2SUpdateRayTraceCoords> { private int xCoord; private int yCoord; private int zCoord; public PacketC2SUpdateRayTraceCoords() { } public PacketC2SUpdateRayTraceCoords(int xCoord, int yCoord, int zCoord) { //these are obtained from the client this.xCoord = xCoord; this.yCoord = yCoord; this.zCoord = zCoord; } @Override protected void read(PacketBuffer buffer) throws IOException { xCoord = buffer.readInt(); yCoord = buffer.readInt(); zCoord = buffer.readInt(); } @Override protected void write(PacketBuffer buffer) throws IOException { buffer.writeInt(xCoord); buffer.writeInt(yCoord); buffer.writeInt(zCoord); } @Override public void process(EntityPlayer player, Side side) { //The stuff in here occurs server side } }
-
So As you can see i followed your suggestions and the itemstack is invulnerable but once I pick it up I cannot drop the itemstack from my hotbar or inventory. would you know why?
-
if I change @Override public Entity createEntity(World world, Entity location, ItemStack itemstack){ System.out.println("HERE"); return new EntityIndestructableItem(world, location.posX, location.posY, location.posZ, itemstack); to @Override public Entity createEntity(World world, Entity location, ItemStack itemstack){ System.out.println("HERE"); return new EntityIndestructableItem(world, location.posX, location.posY, location.posZ); I can drop the item but it immediately turns into a stone block which i pick up immediately.... anyone know what the issue is?
-
I figured out that my entity was invisible (I had to register the entity in common proxy which i fixed) so now when the lava goes to destroy the item it persists however I still cannot drop the item once I pick it up. Any ideas what would cause the item not to be droppable using the Q btn?
-
In my item.java class I did the following @Override public boolean hasCustomEntity(ItemStack stack){ return true; } @Override public Entity createEntity(World world, Entity location, ItemStack itemstack){ System.out.println("HERE"); return new EntityIndestructableItem(world, location.posX, location.posY, location.posZ, itemstack); } @Override public int getEntityLifespan(ItemStack itemStack, World world){ return Integer.MAX_VALUE; } public class EntityIndestructableItem extends EntityItem { public EntityIndestructableItem(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); isImmuneToFire = true; } public EntityIndestructableItem(World world, double x, double y, double z, ItemStack stack) { super(world, x, y, z, stack); isImmuneToFire = true; } public EntityIndestructableItem(World worldIn) { super(worldIn); isImmuneToFire = true; } @Override public boolean isEntityInvulnerable() { return true; } @Override public boolean attackEntityFrom(DamageSource source, float amount) { if(source.getDamageType().equals(DamageSource.outOfWorld.damageType)) { return true; } // prevent any damage besides out of world return false; } } but now I cannot drop the item on the ground and the if the item is on the ground then it disapears when lava kills it and when I take lava away the item reappears
-
Hi Everyone (yes i should probably update my forge to the newer version but that'll take forever atm and I havent been on in a while but) How would you make an itemstack indestructible (and by that i mean if it gets thrown into lava or gets left out in the world the item wont ever be destroyed no matter what happens to it)? Is this even possible?
-
[1.7.10] Resizing the players hitbox/collisionbox: How would you do it
Thornack replied to Thornack's topic in Modder Support
Anyone have any other ideas? Ernio suggested I move my dev environment to 1.8 so i can use net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup to move the camera but.... when I did that it resulted in 1500+ errors of all sorts and its very overwhelming to deal with that so ill stick to 1.7.10 for now. Does anyone have any other solutions? -
[1.7.10] Resizing the players hitbox/collisionbox: How would you do it
Thornack replied to Thornack's topic in Modder Support
Ive tried a few things and havent found a good solution to this. Can anyone think of any way to solve the clipping issue where the players head is inside the block after the players hitbox was resized and eye height was changed?? -
[1.7.10] Resizing the players hitbox/collisionbox: How would you do it
Thornack replied to Thornack's topic in Modder Support
Setting the ySize variable every tick and then moving rendering upwards solves the issue where the head goes into the block but you still get the weird black halo and the model goes black (unless you are flying). Does anyone know how to solve the head going through a block problem in a different way so that it will go under the block without having the weird black texture issues? -
[1.7.10] Resizing the players hitbox/collisionbox: How would you do it
Thornack replied to Thornack's topic in Modder Support
Im just messing around with this some more, Ive moved away from using Tick event and I have a problem. I cannot set the ySize once. My morph function is called once and that is triggered by a button click from the user. This function is called server side only and so when I reset the bounding box I then have to update the client via a packet. My packet is as follows. public class PacketSyncS2CBoundingBox extends AbstractMessageToClient<PacketSyncS2CBoundingBox> { private float playerWidth; private float playerHeight; // private float playerYSize; private float playerEyeHeight; public PacketSyncS2CBoundingBox() {} public PacketSyncS2CBoundingBox(float playerWidth, float playerHeight,float playerYSize, float playerEyeHeight) { this.playerWidth = playerWidth; this.playerHeight = playerHeight; //this.playerYSize = playerYSize; this.playerEyeHeight = playerEyeHeight; } @Override protected void read(PacketBuffer buffer) throws IOException { playerWidth = buffer.readFloat(); playerHeight = buffer.readFloat(); //playerYSize = buffer.readFloat(); playerEyeHeight = buffer.readFloat(); } @Override protected void write(PacketBuffer buffer) throws IOException { buffer.writeFloat(playerWidth); buffer.writeFloat(playerHeight); //buffer.writeFloat(playerYSize); buffer.writeFloat(playerEyeHeight); } @Override public void process(EntityPlayer player, Side side) { System.out.println(" CLIENT MORPH width "+playerWidth +" height "+ playerHeight +" eyeHeight "+ playerEyeHeight); player.width = playerWidth; player.height = playerHeight; //player.ySize = playerYSize; player.eyeHeight = playerEyeHeight; player.boundingBox.setBB(AxisAlignedBB.getBoundingBox((double)player.boundingBox.minX, ((double)player.boundingBox.minY), (double)player.boundingBox.minZ, (double)player.boundingBox.minX + 0.9D,(double) player.boundingBox.minY + 0.9D,(double) player.boundingBox.minZ + 0.9D)); } } Now, the reason I commented out the ySize variable is because if I change it on the server and then send the packet and update its vaue on the client the ySize variable changes. It seems to decrease until it is 0 again. Hence I run into the issue I had before where my players head collides with the box and I get the following: this is a series of screenshots of my player moving through a 1 block tall gap under this bridge from the left to the right. As you can see in the middle image the players head is inside the block rather than under it my players head goes inside of the block. I want the players head to go under the block. When I changed the YSize in onTick it worked great because the ySize variable couldnt change (but this introduced the issue of rendering the model with the dark overlay texture and that weird oval texture from before). Does anyone know how to fix the head going through the block problem that you see in the above photo (the middle screenshot)?