Jump to content

santyclause

Members
  • Posts

    2
  • Joined

  • Last visited

santyclause's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Yes I have used that combo to check the hit box. For both sizes, it will show the box changing to the right sizes so long as I'm actively touching blocks. Once I'm not in collision with a block, it reverts to normal. The box changing also doesn't seem to have much of an effect as it won't let you pass under gaps you would be able to if you were only 1 block tall for instance. Also, if I press the keybind when not pressing against a block (outside of what I'm standing on) all it does is move me south-east a small fraction of a block with no visible change to the hit box. I think you might be right, here is the rest of my KeyHandler: public class KeyHandler { private static final Minecraft mc = Minecraft.getMinecraft(); public KeyBinding keySmall = new KeyBinding("Toggle Small", Keyboard.KEY_M, "More Hitboxes"); public KeyBinding keyLarge = new KeyBinding("Toggle Large", Keyboard.KEY_N, "More Hitboxes"); public KeyHandler() { ClientRegistry.registerKeyBinding(this.keySmall); ClientRegistry.registerKeyBinding(this.keyLarge); } @SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { if (keySmall.isPressed()) { System.out.println("THIS SHOULD BE VISIBLE IN THE LOG"); EntityPlayer player = event.player; float width = 0.6f; float height = 0.4f; AccessThing.setSize(player, width, height); } if (keyLarge.isPressed()) { System.out.println("THIS SHOULD BE PRETTY VISIBLE TOO"); EntityPlayer player = event.player; float width = 0.6f; float height = 2.0f; AccessThing.setSize(player, width, height); } } } I'm not really doing anything server related right now. Is there a ServerRegistry or something I need to toss in?
  2. Hey everyone, for the past however long, a friend and I have been slowly trying (and recently failing) to create our own private little mod that only has two little functions: change the player hit box to be either half the size of the normal player hit box or be 1 block taller than normal. In other words, one of us should be able to fit under 1 block while the other can only fit if the gap is at least 3 blocks tall. We just need to get it to work for only the two of us on our private server. We also don't need to worry about eye level/model height because we are basically making this as an add-on to a separate mod that does that. With that in mind, we were hoping to be able to use setSize() to take care of all our problems in life but it has not been working like that. It seems to change the hit box so long as you are colliding with something but it still acts like the default hit box either way. Our current code in question looks like this: segment in KeyHandler.java @SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { if (keySmall.isPressed()) { System.out.println("THIS SHOULD BE VISIBLE IN THE LOG"); EntityPlayer player = event.player; float width = 0.6f; float height = 0.4f; AccessThing.setSize(player, width, height); } if (keyLarge.isPressed()) { System.out.println("THIS SHOULD BE PRETTY VISIBLE TOO"); EntityPlayer player = event.player; float width = 0.6f; float height = 2.0f; AccessThing.setSize(player, width, height); } } in AccessThing.java (Great name I know) package net.minecraft.entity; import net.minecraft.entity.player.*; import net.minecraft.util.math.*; public class AccessThing { public static void setSize(EntityPlayer player, float width, float height) { player.setSize(width, height); } } Every test of this has been in singleplayer so far. Also, this isn't the most efficient code in the world. I'll be cleaning it up at some point in the future. What are we missing that would get this working? Oh and it's fine if we need to get makeshift, we just need to get it to work.
×
×
  • Create New...

Important Information

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