Started by
Liam5095
on
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make a graffiti thingy but i dont know how to do if the player right clicks and is facing a block then place a painting at that block
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make a graffiti thingy but i dont know how to do if the player right clicks and is facing a block then place a painting at that block
Depends on whether you want the paint to be a block, or an entity like a regular painting. If it's a block it's as easy as just making a procedure to place the block at the correct location, but it would probably look weird and have some issues with rendering.
If you want it to be an entity like paintings, that'll probably look better, but it'll be a little more complicated. You need to emulate the behavior of paintings- that means making an entity with a locked direction and position, checking for blocks behind it, determining the correct rotation, etc. Entities can be really finicky, so getting this to work could be difficult. The principle would be the same though, you would just need a procedure to spawn the entity at the correct position when the player right clicks a block. (Using the 'when entity right clicks with item' procedure trigger.)