Started by
unseen433
on
Topic category: User side tutorials
Im trying to figure out a way to make a dash enchantment. The idea is that when the player right-clicks with a sword they are propelled forward.
An example is that if you have dashing 5 and you right-click with a sword, you will be propelled forward 5 blocks.
Thank you to anyone that helps
First , create a enchantment 'Dashing' with maximum level of 5 , then create a procedure and recreate this:
Event trigger - Player right clicks with item
If ---------------And-----And----------- Has provided itemstack enchantment Custom:Dashing
| ----------- Get level of enchantment of provided itemstack type Custom:Dashing = 5
L______________ Is provided itemstack tooltype = Sword
Do ------ Execute command / tp @p ^5 ^ ^ at x y z
(These are all procedure blocks)
let me know if this helped.
It wouldn't really be dash but teleport, as the player would be able to pass through blocks with it. And it would always teleport player on the x axis, so in one of 8 different directions.
I would instead either increase motion of the direction player is facing, or make a check if there are blocks in the way of the player (that aren't grass), check which direction player is facing and tp on that axis for either -5 or 5.
Also I'm pretty sure you don't have to make such a big if block, instead you can create a local variable called "level" and assign to it enchantment level, and then when specyfying how many blocks player should dash through just use "get local variable: level"
For the dash instead of the teleportation, here is the procedure :https://mcreator.net/forum/69055/how-does-one-send-player-direction-hes… increase the range depending on the enchantement level, multiply each final value (the result of the calcul of x, y and z) by the level of the enchantement