Started by
CrafterMatt
on
Topic category: Help with Minecraft modding (Java Edition)
Pls help I'm trying to create a Henry Danger and Danger Force mod and trying to create henry's hyper motility so pls help.
Topic category: Help with Minecraft modding (Java Edition)
Pls help I'm trying to create a Henry Danger and Danger Force mod and trying to create henry's hyper motility so pls help.
You can use the 'set location' function, (found in entity management), to teleport entities such as the player. From there, you'll need to use the 'get look angle vector' function to get the direction the player is looking at, and teleport them accordingly.
There are a couple ways you could do this. Simpler methods involve just getting the block the player is looking at, (which is its own built in function), and teleporting the player on top of it if there's air available and the block isn't too far away. A more complicated method would be to use the look angle vectors to determine how far to teleport the player on the X, Y, and Z axis. (Look angle vectors range from 1 to -1 on each axis depending on which direction the entity is looking, and can thus be multiplied and then added to the player's current position.)
The most complicated method, (and the one I prefer for this sort of thing), is to use trig functions to teleport the player based on both the look angle vector and their current velocity. However, this probably involves more math than is really necessary for your purposes.
Could you pls send a photo to make it a bit easier and thanks for the help. You've been my favourite modder. Can't believe this. I played your superior smithing, yor cooking mod and more. They are all good! Excellent job!
This is what I used for warp-boots that teleport the player forwards. (Keeping in mind this doesn't check if there's actually available space ahead, and will teleport you into a wall if there isn't, for me this is intentional.) The orange blocks all do particles and sound effects, the 'Set Location' block is the only really important one.
The X look angle vector, (if the player is looking directly east), is positive one, and the z look angle vector, (if the player is looking directly east), is zero. So, if the player teleports while looking east, they teleport (1 8.5) blocks east from their current position, and (0 * 8.5) blocks in the z axis. I didn't configure the Y axis because I only wanted horizontal teleportation, but you could do the same thing there.
Then, the Dash cooldown thing is just a player variable that goes down every gametick, stopping at zero. The Dash Cooldown has to equal zero for this to execute, just so the player can't spam teleportation.
Thanks so much
Could you also kindly tell me how to make a cooldown because it felt like I went 50 blocks forward and it continues if I hold right click
You could create a global variable for the player, (there's a 'variables' tab in your main workspace), then make a procedure that decreases it by one on player update tick until it equals zero. This way you can check if the variable equals zero before teleporting, and increase it when the player teleports.
...Of course, if you're just using a handheld item, there's also a built in 'Cooldown item' function in the item procedures tab that'll work just as well, and gives a visual indicator of cooldown.
Sorry for the asking and questions but I do not really know how to code. So could you also send me a picture pls?
Something like this, where 'DashCooldown' is a global, player-persistent variable, which you can assign in the 'variables' tab of your main workspace. Then, put the dash behavior in an 'if' bracket that checks if Dash Cooldown equals zero.
I highly recommend NorthWestTrees MCreator if you want some decent tutorials. Even if you're using visual code, a good idea of basic principles will be pretty essential if you're going to do anything more advanced.
Thanks could you help me to make a block that if you right click on it it would teleport you to a certain block pls.
Sorry no entity, when you right click on it, it teleports you to a specific entity
hello how can you do to check if there space ahead?
You would check if block at x y z and x y+1 z is air. Where x y z are the coordinates of the point your trying to teleport to. Eg in the example above it would be:
[(x) + (x look angle vector)*(8.5)] [y] [(z) + (z look angle vector)*(8.5)]