Started by
AppleMod
on
Topic category: Help with Minecraft modding (Java Edition)
How can I make a procedure where if a player right clicks lava they get my custom item a lava bottle? I've been experimenting and my main problem is where to trigger the event from.
Using "Player right clicks with item" global trigger:
1. Check if the player is holding a glass bottle, only proceed with the rest of the method if this is true, else do nothing.
2. Create 3 local number variables, [x], [y], and [z]. Set them to "Look [x/y/z] position of [event entity] with raytrace distance..."
3. Set the raytrace distance to the reach distance of the player (from memory it should be 4?) and set fluid mode to
SOURCE_ONLY or ANY, depending on whether you want to target only lava sources or lava regardless of slope level.
4. If {Get block at [x], [y], [z] == [Lava Still]} (For SOURCE_ONLY)
If {Get block at [x], [y], [z] == [Lava]} (For ANY)
Remove block at [x], [y], [z] (Skip if you dont want to remove the lava)
Remove 1 glass bottle from the inventory event entity
Add 1 lava bottle to inventory of event entity
Thanks, but I'm having trouble. I get that I have to make variables, but what are the names of the blocks at the beginning. This is what I have so far. Please help
https://www.linkpicture.com/q/plshelp.png
Let me know if there are any issues; this was working for me!
I'll try it as soon as I can! Thanks
I started work on it:
Sorry, how do I actually make the variable?
Where do I find the Set Local block?
To create a variable at left of your mcreator app there is a place that says "Variables" just click that and you can create your variables. Here are information about their types and usage - https://mcreator.net/wiki/variables
As for "Set local block" you could probably type it in search bar in procedures or just check every single procedure blocks tbh
Sorry, what do I do here?
Also I've tried searching and looking through every block manually I just can't find it. What am I missing?
*What do I do here:
https://imgur.com/a/0ETTuRR