Started by
Cr@ezir
on
Topic category: Help with Minecraft modding (Java Edition)
Im trying to make a sword that lets me teleport in the direction im looking and also create an explosion at that location. Basically im trying to make a weapon called the hyperion from hypixel skyblock's. The problem is i found a video on how to do it but it will only let me teleport north, west ,south and east it would not let me teleport in the actually direction i was looking.
i think you need to use raytracing
How do I use ray tracing on mccreator
Use "look position" procedure blocks. You should use all three parameters: x, y, z.
me personally i created a ranged item that teleports then make the sword a keybind that shoots the range at speed 300
So it works but now if im looking at a block and right click i just clip in the block which i dont want. Is there a way i can make it that it will detect there is a block and teleport me right behind it?
@Cr@ezir Under right click on entity pos. in item triggers, use the orange command block and put this into it: "tp @p ^ ^ ^8" (Set the 8 to however far you want to tp) Then get a explode block from world management and volia
Also unfortunately, I haven't found a fix for the tp'ing into blocks, but at least this is more reliable than using raytracing. Plus I forgot to say, before doing the explosion, give the player resistance so they don't die when you do the explosion. (Also you might find that you will leap in the air when the explosion happens. Again, I haven't found a fix for this. If I do, I'll let you know!)
Nvm don't do my method, use the raytracing. It fixes the block clipping