Jump to content

How do i control the collision box size of my entities?


Drachenbauer

Recommended Posts

Hello

 

Most of my Angry Birds entities are smaller than one block.

But i noticed, that i cannot place a Block directly above them (to create an one block high hone around them)

It seams like they cannot enter an one block high hole in a wall.

How can i change the size of their collision-box to fit their body-size?

Edited by Drachenbauer
Link to comment
Share on other sites

3 hours ago, Drachenbauer said:

Now i found a way to add the size in the registration-lines, like at the munitions.

 

But now i noticed, that my entities get hutr, if swimming in water.

How to fix this?

to see the size thing at my entities, look in my repository:AngryBirdsMod on Github in the main-class "AngryBirds" in the entity-registry-event.

Drowning in water is determined by the mobs "eye height" which can be set independently of the collision box. Turn on collision boxes in game and you should see a red square either within or above the collision box: this is the mobs eye height.

 

Edit: looking at your source code, it seems you have mob eye height set at as little as a quarter of the mob height.

Edited by salvestrom
Link to comment
Share on other sites

most of my mobs are a half block high and have their eyes in the middle of their front.

So i had to set the eyehight as a quater of a block-hight to fit with the eyes on the texture. (i thaught, the value for eyehight is calculated from 1 as block-hight).

 

If i show collision-boxes, i see a red frame and a blue beam, wich, i think, show the eye-hight.

but they are located just a little below the top of the collision-box.

The hight of theese markers does not change, if i change the value of eyehight

How is the eyeHight-value calculated actually?

How do i find the right values to move this to the hight, where the eyes are located on the texture?

 

And is there a way to change, how deep they sink into the water while swimming?

Here are two pictures of an Angry Birds toons episode, where you can see the birds swimming in the sea while a beach-day:

Angry Birds swimming scene 1

Angry Birds swimming scene 2

They float high on the water-surface, just like light wight beach-balls or balloons, filled with air.

I wand to realize this effect with my Angry Birds-mobs, too.

Actually they sink too deep into the water

most of them sink about the half of their hight, the smallest ones sink compleetely below the surface (similar to ice, that floats in water).

I want to reach, that only about 1/8 of their hight is actually below the water surface, while they swim (no matter, how big or small they are).

Edited by Drachenbauer
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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I want to download Forge 1.20.6, but when I press download, it redirects me to Adfocus and does not provide any download. I have never encountered such a problem when I downloaded Forge 1.18.2 at least 12 months ago.
    • did you find any solutions? i have the same problem and also that mahito doesnt transform
    • Here's a simple example to solve this particular issue: public class ModArmorMaterials { public static final DeferredRegister<ArmorMaterial> ARMORS = DeferredRegister.create(Registries.ARMOR_MATERIAL, MyModName.MOD_ID); public static final RegistryObject<ArmorMaterial> COPPER = registerArmor("copper", Util.make(new EnumMap<>(ArmorItem.Type.class), enumMap -> { enumMap.put(ArmorItem.Type.BOOTS, 1); enumMap.put(ArmorItem.Type.LEGGINGS, 4); enumMap.put(ArmorItem.Type.CHESTPLATE, 5); enumMap.put(ArmorItem.Type.HELMET, 2); enumMap.put(ArmorItem.Type.BODY, 4); }), 12, SoundEvents.ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> Ingredient.of(Items.COPPER_INGOT)); private static RegistryObject<ArmorMaterial> registerArmor(String pGroup, EnumMap<ArmorItem.Type, Integer> pEnumMap, int pEnchantmentValue, Holder<SoundEvent> pEquipSound, float pToughness, float pKnockbackResistance, Supplier<Ingredient> pRepairIngredient) { List<ArmorMaterial.Layer> pLayerList = List.of(new ArmorMaterial.Layer(new ResourceLocation(pGroup))); return registerArmor(pGroup, pEnumMap, pEnchantmentValue, pEquipSound, pToughness, pKnockbackResistance, pRepairIngredient, pLayerList); } private static RegistryObject<ArmorMaterial> registerArmor( String pGroup, EnumMap<ArmorItem.Type, Integer> pEnumMap, int pEnchantmentValue, Holder<SoundEvent> pEquipSound, float pToughness, float pKnockbackResistance, Supplier<Ingredient> pRepairIngredient, List<ArmorMaterial.Layer> pLayerList) { return ARMORS.register(pGroup, () -> new ArmorMaterial(pEnumMap, pEnchantmentValue, pEquipSound, pRepairIngredient, pLayerList, pToughness, pKnockbackResistance)); } public static void register(IEventBus eventBus) { ARMORS.register(eventBus); } } Essentially, the TierSortingRegistry has been removed and so you now need to set up your own DeferredRegister. Please see the minecraftforge GitHub for more information; I found this solution through their issues (https://github.com/MinecraftForge/MinecraftForge/issues/9961)
    • How did I even leave that in there? I’ll try it in a bit, that very well could be it.
  • Topics

×
×
  • Create New...

Important Information

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