Started by
JustDorkyy
on
Topic category: Help with Minecraft modding (Java Edition)
Alright so i'm trying to make a entity spawn in front of the player when i right click on an item, i dont want to look at the ground to do it i just want to spawn an entity exactly in front of the player (no codding please)
You can't do it without coding.
Make the trigger "If player right clicks air with item" and spawn entity depending on player direction, that will spawn "x+1", "y", "z" or "x-1", "y", "z", or "x", "y", "z+1"; "x", "y", "z-1"
Use New Procedures Plus+ plugin, it can execute procedures in front of the player
all of the replies making it complicated or saying you cant are tripping. just make a procedure with a global trigger of "when player right clicks", do an if statement checking if the item is in the players hands, then use "spawn entity at" block, replacing xyz with the raytrace xyz blocks, set the distance of those to how far you want the mob spawned
if you want it to simply spawn if front of the player no matter the direction your looking its still not hard just slightly more work. you need an if statement with 3 else if statements. for each if statement check the direction the player is looking(ex: if direction of event/target entity = north), then summon the entity relative to that (ex: if the player is facing north summon it at x y (z-1)(or replace 1 with distance you want the entity to spawn from you)
for each direction you change with coordinate you modify, North=-Z, South=+Z, East=+X, West=-X