Jump to content

Custom hitbox for my mob


thatbritshgamer

Recommended Posts

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/

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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/

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.