Started by
ThorPDough
on
Topic category: Help with Minecraft modding (Java Edition)
I would like to place a block at the location the player is looking if the current keybinding is pressed,
how do I do it?
Topic category: Help with Minecraft modding (Java Edition)
I would like to place a block at the location the player is looking if the current keybinding is pressed,
how do I do it?
You have raytrace entity look position for x y and z coordinates procedure blocks. This is pretty basic procedures.
I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei
how do you do that?
Just make a procedure and set it to have any trigger, make sure it has an entity in the trigger (make sure the trigger is todo with the player otherwise it won't work).
inside the procedure just make a Place block procedure block at the start (this procedure block can be found in the block section in the side bar).
Then instead of X,Y,Z replace those with "look raytrace x position of Event/Target Entity for 100 blocks" (this procedure block can be found under the entity side bar) then do the same in the other X,Y,Z slots of the place block procedure block changing the X to either Y or Z for their apropriate slot in the "place block" procedure block.
Now in the place block procedure block set the block to be placed to whatever you want and then try it.
If you want to change the block being placed whilst the game is running change the block part of the Place block procedure block to be the procedure block "convert [item] to block or air if conversion fails" (found in the block tab) and set the item to be the item in the off hand of the entity (this procedure block is found under the entity tab).
Is there a way to make it so the player can look at a mob and for example, spawn a shulker bullet at the mob's location?
Here is a tutorial I made: link