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

  • Author

i am making a zombie for my mod and i want it to be headshot only and i use techne/eclipse there was code o one of the old posts just wanna know how to impliment and add the height ect plus i already have everything coded just need to do headshot only

  • Author

just like this got random numbers btw setEntityBoundingBox(new AxisAlignedBB(newPosX=2, newPosX=6, newPosX=7, newPosX=8, newPosX=9, newPosX=10...))

First of all, there is only one built-in bounding box per entity and I think it is also used for path-finding collisions. In other words, the bounding box always tries to touch the ground. So I think that if you make the bounding box to just be the head, then I think you'll have problems with movement -- for example I think the zombie would sink into the ground so only the head was showing. So I think the best way to look for headshots is to leave the regular bounding box and get the height of the arrow entity at the point when it collides with your entity and compare heights.

 

Anyway, the coordinates in the Techne model are "pixels" and I think you'll find that the origin is 24 pixels high which is therefore 1.5 blocks high (there are 16 pixels per block). Therefore, if you really wanted to have the bounding box be the head, I think you would have to check for collisions with an AABB that is positioned at 1.5F higher than the zombie's position.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Actually, it is very much possible to have multiple hitBoxes assigned to one entity.

 

It is just very damn long job to make it look nice (abstraction).

BUT, for modders that are not super experienced or don't have time to do this on their own - there is API: LLibrary which (supposedly) allows to have entities with multi-boxes :D

 

Idk if its updated to 1.8 tho. Might be worth checking (I personally had enough time to make my own system, so don't ask me).

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

Actually, it is very much possible to have multiple hitBoxes assigned to one entity.

 

Of course you can code such a system. But the original poster seemed to be hoping for some built-in method to easily create it, and the thread seemed to be leading to the idea that you can use the setSize() method to change this, but you can't.

 

But like I said, it isn't too hard for an intermediate coder. I personally would still use the vanilla hitbox to be big enough to register any hit, and then when there is a hit, just check for whether the arrow was within a hitbox AABB.

 

Note though that people who have done some work with multiple hitboxes before mention that you don't want to make critical hitboxes that are too small because the hitting in Minecraft really isn't that precise, especially if you encounter network lag.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Minecraft really isn't that precise, especially if you encounter network lag.

 

Actually, from what I remember - it is the client that tracks hits, isn't it? Two different clients might be in "slight" different delay which would create situation where both of clients might relatively hit different x/y/z place in dimension, but still hit the same target - since it's their client that handles tracking if thing was hit.

 

The server only decides if such action was possible (distance).

 

I mean, unless I got that wrong, I've been looking there just a tiny bit for now.

Also - that is the reason why hacks can easily make kill aura and server usually have plugins (ani-cheats) with additional attack packet checking such as player rotation (you can only hit what's before you) and attack mini-cooldown.

 

For throwables (arrows) it is not client's concern, arrows travel/damage on server (I think).

What is actually critical here is the fact that for lagged players it will be just annoying (sometimes impossible) to keep targeting e.g neck or knee.

 

Just note: As stated before - it is not FACT, but code observation. Not 100% sure, but pretty much.

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

What is actually critical here is the fact that for lagged players it will be just annoying (sometimes impossible) to keep targeting e.g neck or knee.

 

Just note: As stated before - it is not FACT, but code observation. Not 100% sure, but pretty much.

 

Yeah, that is my opinion too. You can certainly code a precise hitbox, and logically it will be correct, but practically it could be really annoying where the client looks like it hit but server doesn't register it due to lag. Like you said, you can't have the client determine the hit because that opens the door for hacking.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.