Started by
PoisonousPotato
on
Topic category: Help with Minecraft modding (Java Edition)
Help me, please?
I want that with your fists (hands) you can only break:
- Dirt, Sand and similar elements.
- Plants, Leaves, Lilypads and similar elements.
- Other weak blocks (i actually don't need to tell everything, because i will add to the code)
Here's an easy one that you can probably help.
I also want so that Glass, Glass Pane, Stained Glass, Stained Glass Pane and Tinted Glass will hurt you.
(and my custom Tinted Glass Pane, Uranium Glass and Uranium Glass Pane).
Kind of a weird solution i have, but it might work: Make a procedure for "A block is broken" and make it Check if the block you just broke is = to the (Block you don't want broken) and if it is then use "Place Block" and make it place the Block you didn't want to break. Elsewise im not really sure how you would make every default minecraft block unbreakable... Maybe even if you test if the Block you are Looking at "With Raycast" is = to the Block you don't want to break, And if it is then set Potion "Mining Fatique" too a very high number and only for 1 Tick, So it will constantly give you mining fatigue if you are not looking at the Correct breakable Blocks. Also make sure in both scenarios you are checking that the Event Entity that broke the block has Empty Main Hand. Hope this helps someway, Im not at my workspace right now so kind of hard to give you a full detailed explanation..