
ReturnMOP = new MovingObjectPosition(pointedEntity) If (pointedEntity != null & (d < calcdist || returnMOP = null)) MovingObjectPosition mop0 = aabb.calculateIntercept(pos, var8) Vec3 var8 = pos.addVector(lookvec.xCoord * var2, lookvec.圜oord * var2, lookvec.zCoord * var2) įloat var9 = list = mc.theWorld.getEntitiesWithinAABBExcludingEntity(theRenderViewEntity, theViewBoundingBox.addCoord(lookvec.xCoord * var2, lookvec.圜oord * var2, lookvec.zCoord * var2).expand(var9, var9, var9)) įloat bordersize = entity.getCollisionBorderSize() ĪxisAlignedBB aabb = new AxisAlignedBB(/2, entity.posY, /2, entity.posX+entity.width/2, entity.posY+entity.height, entity.posZ+entity.width/2) Īabb.expand(bordersize, bordersize, bordersize) Vec3 lookvec = theRenderViewEntity.getLook(0) Vec3 pos = theRenderViewEntity.getPositionEyes(0) Ĭalcdist = (pos) ReturnMOP = theRenderViewEntity.rayTrace(var2, 0) Minecraft mc = FMLClientHandler.instance().getClient() Įntity theRenderViewEntity = mc.getRenderViewEntity() ĪxisAlignedBB theViewBoundingBox = new AxisAlignedBB( Public static MovingObjectPosition getMouseOverOrig(float dist) (DamageSource.causePlayerDamage(ayer), 4.0F) įMLClientHandler.instance().getClient().playerController.attackEntity(ayer, mov.entityHit) ("Attacking entity with extended reach") MovingObjectPosition mov = getMouseOverOrig(reach) // FMLClientHandler.instance().getClient().getRenderViewEntity().rayTrace(reach, 0) // getMouseOver(0, reach) Ieri = (IExtendedReach) itemstack.getItem() If (itemstack.getItem() instanceof IExtendedReach) If (event.phase = ) // only proceed if START phase otherwise, will execute twice per tick

Public void onEvent(PlayerTickEvent event)
LET IT DIE PC HITBOXES CODE
I haven't checked how far you can extend the reach, but the code basically uses ray trace so I think it would simply be limited by whatever that method can receiveCanceled=true) And the attack is run through the FMLClientHandler which I suppose helps manage the sync. I've only tested it on integrated server single player, so I'll try it on separate server to see if there are issues. I'm not doing it in a "client event", but rather PlayerTick which I believe runs on both sides?
LET IT DIE PC HITBOXES MOD
What I mean - if doing whole thing in client event and just telling server to do it (attack) works, wouldn't that mean that you can write client mod that will extend your reach to e.g 10 blocks? Why does the server allow such reach-change if it goes from client?ĮDIT: My guess is there is some auto-correcting thing where server allows values up to some point, because if there is not, the above would be true, and that is just ridiculus for me. I always planned to look into BWM but looking at it now - could someone explain to me not how, but WHY calculating reach and making attack on client works with server? I do know it is a tough problem though hence any input is appreciated.Įxtending reach was on my todo list for some time (after I finish other stuff) and I'll be there soon. I think some people have kinda dabbled into this a little bit, my goal is to get a fully working solution to this. hence why I need to change the players hit mechanics and the players hitbox size. When you are my large model your reach distance should be a lot greater, but due to its size you should have movement penalty n not be able to fit into all places. To make it look and work properly I need to have the position of the + cursor to be farther away from the model and represent the players reach distance. However, this model will only permit the player to play in 3rd person view. The reason being is I have a very large model that the player can become. The diagram above hopefully clearly shows what I need to do so that the players reach is calculated from a different position.Īlso I also need to resize the players hitbox to be smaller or larger (when you hit F3 +B) the large hitbox that appears I would need to scale that.

specifically to change the position of the players punching box (when you hit F3 + B) it would be the small white cube inside the players large hitbox (at least I believe this small hitbox represents the players arm and is used for actual collision calculations?). I need to change the way the players hit mechanics work. Hi everyone, hopefully the image above clearly demonstrates what I need to do
