Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16] PlayerEvent affecting all entities?


Recommended Posts

    public void onSizeChange(PlayerEvent.Size event) {
        if (!(event.getEntity() instanceof PlayerEntity)) return;
        EntitySize newSize;
        switch (event.getPose()) {
            case CROUCHING:
                newSize = EntitySize.fixed(0.6f * SizeMod.sizePercentage, 1.5f * SizeMod.sizePercentage);

            case SWIMMING:
            case FALL_FLYING:
                newSize = EntitySize.fixed(0.6f * SizeMod.sizePercentage, 0.6f * SizeMod.sizePercentage);

            case SLEEPING:
                newSize = EntitySize.fixed(0.2f * SizeMod.sizePercentage, 0.2f * SizeMod.sizePercentage);

            case DYING:
                newSize = EntitySize.fixed(0.01f, 0.01f);

                newSize = EntitySize.fixed(0.6f * SizeMod.sizePercentage, 1.8f * SizeMod.sizePercentage);
        event.setNewEyeHeight(newSize.height * 0.9f);

I can't seem to figure out what's going wrong with my code. It seems like it should only affect players but any mob that spawns has its hitbox changed as well as any item that's dropped. Does anyone happen to know what's going on here?

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.

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.


  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.