Jump to content

Recommended Posts

Posted

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

Posted

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/

Posted

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.

Posted

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/

Posted

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.

Posted

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...

×   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

    • I have a custom 3d model which works perfectly. BUT I want it to be held diffrently on the players hand when the item is being used. My JSON file under assets/examplemod/items looks like this: { "model": { "type": "minecraft:condition", "on_false": { "type": "minecraft:model", "model": "examplemod:item/example_item" }, "on_true": { "type": "minecraft:model", "model": "examplemod:item/example_item_using" }, "property": "minecraft:using_item" } }   This works fine until the item is used. The correct model will be displayed but with a full black texture instead of the actuall texture. Any idea why? (I want to use the exact same texture for both items, because their model is the same just diffrent displays on firstperson_righthand and firstperson_lefthand). The models JSON's are fully blockbench files inlcuding the elements, display, textures with texture_size.   Also is this the correct way to do it? Because it feels so dumb to change the exact same model just for a diffrent right- and lefthand view.   (fyi: ItemUseAnimation is BLOCK for this item)
    • I just backed up my world then tried to create new mod with currently equipped mod but with new world still made same error. Sooo I think it's not world error. also It's working fine on singleplayer. + but it made some another weird error with new world
    • Maybe the file is too large - you can upload the log file via Mediafire
    • Create a new instance and start with Embeddium + Oculus Then add new mods one by one or in groups The "IncompatibleClassChangeError: class net.coderbot.iris.gui.option.ShadowDistanceOption" often appears in connection with an incompatible mod
    • I hosted forge modded server using feather client I was able to join without any issues yesterday, but today after I tested my shader on my single world then tried to join the world but it made error meassage. (I also changed server.properties's render settings, but I reverted it as same as yesterday) So I removed my shader and removed optifine on server and on my mod file then it made this error: Internal Exception: io.netty.handler.codec.DecoderException: net.minecraft.ResourceLocationException: Non [a-z0-9/-1 character in path of location: inecraft:ask_server\u0012\u0001\uFFFD\n\u0007targets\u001D\u0001\u0014minecraft:ask_server\u0012\u0002\uFFFD\n\uFFFD\n\u0002id!\u0014minecraft:ask_server\u0002 \u0001\uFFFD\n\u0006target\u0006\u0001\u0002\u0001\uFFFD\n\ttarget My server/client is 1.20.1 forge. And I got 34 mods total, it was working pretty fine yesterday (I did not add/remove any mods before it started happening) I hope it's not about my worlds, it's been quite long since using this world I'm not native english speaker so there may be grammar issue! Thank you for reading!
  • Topics

×
×
  • Create New...

Important Information

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