How To Change Player Size In Minecraft
1.half-dozen.four
- Search
- Tools
Changing Player Size(Solved!)
How To Change Player Size In Minecraft,
Source: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/2413392-changing-player-size-solved
Posted by: autennoter2002.blogspot.com
#ane Apr 25, 2015
Hullo everyone,
I am having a bit of problem with a World State of war 2 modern I am making. I want to make information technology as realistic as possible, with every warship, tank, and plane that fought, even nation choice and npcs, it'south not only going to be another flans modern. In any example, I have been trying to brand it and so that if you lot sneak with a gun, instead you lot crouch. I volition too be adding lying downwards, but first I must get crouch done. And then far, I have been doing pretty good on the crouching, I have already made information technology then that your viewpoint is lower, and the player is posed differently when crouched. But the problem is, I can't quite become the size of the player to change, then that y'all can fit under a fleck smaller blocks. Even stranger, it appears to work when I set it to a bigger size of the histrion, but not a smaller. I have been irresolute the size by manipulating the setSize method in a server and customer tick handler. Been trying all the different kind of ticks such as Render, Customer, World, etc, but none will work to brand the size smaller, it will only work if I try to make the player bigger. Nonetheless, when I printing f3 + b I can encounter that the hitbox of the role player has been reduced, but I still tin't walk under smaller spaces nomatter how pocket-sized I put the hitbox.
Any ideas?
EDIT: I figured information technology out! I switched World Tick to Player Tick and added this line:
player.boundingBox.maxY = actor.boundingBox.minY + (height);
Rollback Post to Revision RollBack
#2 April 25, 2015
I'g only speculating here, just are you setting the height to exactly 1 block? If then you might need to set information technology to slightly below 1 block since the block is 1 block tall. The histrion might not exist able to pass under information technology as it still doesn't fit, just information technology is very shut. Again I'm simply speculating.
Rollback Mail service to Revision RollBack
The Stuff Extension:
Bank check it out: Here
And on the forums: HERE
#iii Apr 25, 2015
I fix the peak to 0.9 first, and then 0.6, and I can't fifty-fifty go under a ane i/2 block space. Default height is 1.8
Rollback Post to Revision RollBack
#four Apr 27, 2015
Hmm... since morph mod changes player size I decided to look at the source. It seems I am doing information technology the same, in tick handlers for client and server. Strange that it'southward not working for me... I will look a scrap closer in the source code. If anyone else thinks of something, please tell me.
Rollback Post to Revision RollBack
#5 Apr 28, 2015
CoolAlias! I call upon you! I need your help in this dark time!
Haha. If y'all see this, I desire to thank you for all the times you helped me before. Maybe soon I will be able to render the favor, this summer when coding becomes my chore.
Rollback Post to Revision RollBack
#6 Apr 29, 2015
Youll demand to use reflection to admission the vanilla file, its the exact style i add together new potion effects to mc and also how the morph mod changes the thespian height.
On the login, respawn and change dimension events you will have to reset the size and eye pinnacle to brand certain its right merely unless another mod is also effecting the player size such equally morph or Tinkers Construct(It has something to do with armour) may crusade y'all to have damage when you go nether small spaces.
Accept a look at these 2 specific files from the morph modern
This contains examples of how the code is used and what needs to be changed.
https://github.com/sekwah41/Morph/blob/main/java/morph/common/core/EventHandler.java
If you take a look at the forceSetSize method information technology shows y'all how the reflection works.
https://github.com/sekwah41/Morph/blob/main/coffee/morph/mutual/core/ObfHelper.java
Rollback Post to Revision RollBack
#7 Apr 29, 2015
Yes, I use reflection quite oftentimes, and that is what I have been doing. I did detect that what I didn't practise was add the set size to login, respawn, and change dimension events, merely would that make a difference for me not existence able to go underneath blocks? Because for those events it would be set up to the normal size, since the role player would no longer exist crouching.
Later looking at his code, I changed my version of the force set size method to his to see if that made a difference, only it seems mine already did pretty much the same. I had information technology print into the panel the value of the height for both the server and the client, and it is printing the correct value. When I press F3 + B I can fifty-fifty tell the hitbox has inverse, merely I tin can't fifty-fifty walk under a space one 1/2 blocks tall. Like I said earlier, for some reason it works when I prepare it to a larger height that requires more block space to walk through...
Rollback Mail service to Revision RollBack
#eight Apr thirty, 2015
I retrieve the method you need to scrutinize is the Entity#moveEntity() method. It is the one that checks for bounding box collisions and prevents movement. Information technology is a pretty long method so I don't have fourth dimension/interest to sort through it, but yous should probably try to debug trace it or mayhap written report it so yous can see if in that location is any reason it is preventing the movement in your case.
Rollback Post to Revision RollBack
#9 May 1, 2015
You know what? I bet y'all are correct! Neat thinking! I will try that right at present! I volition get dorsum to y'all afterward and tell y'all how it goes!
EDIT: Hmm I run into a problem though.. the fact that it works when I set information technology to a bigger size. I will try it anyways though.
Rollback Postal service to Revision RollBack
#ten May 1, 2015
Rollback Post to Revision RollBack
#xi May 1, 2015
Could you tell the 176 people who have viewed this message how you solved this?
I am curious :-)
Rollback Post to Revision RollBack
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]
#12 May i, 2015
Already did, my adept sir! There is an edit in the OP!
Rollback Post to Revision RollBack
#thirteen May ii, 2015
I'm not really sure why that solution works. The setSize() method pretty much merely sets the aforementioned maxY field. At least it does in 1.7.10. Perhaps in 1.6.4 it is different.. And in i.8 there is a setEntityBoundingBox() part that keeps this info straight in a bounding box instead.
Last edited past jabelar: May two, 2015
Rollback Post to Revision RollBack
#14 May two, 2015
That'south what I idea was strange besides... Either fashion, it works.
Rollback Postal service to Revision RollBack
#15 May 2, 2015
Thanks, I didn't see the edit in the commencement, message.
Rollback Post to Revision RollBack
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]