[Tutorial] How to make custom wood be stripped, while still being able to place blocks

Started by DanilkaD on

Topic category: User side tutorials

Last seen on 14:22, 1. Jan 2022
Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Tutorial] How to make custom wood be stripped, while still being able to place blocks
Sat, 08/22/2020 - 15:41 (edited)

Hello! Many of you have tried making trees strippable, but ran into a problem - the trees strip as normal, but to place blocks, you have to click while sneaking. With the new capabilities of MCreator 2020.4, we can achieve this.

First of all, you need to have the block and it's stripped variant created.

After you've done that, create a new procedure:

Make the event trigger: When player right clicks block

Add: if get block at x y z = (your log)

Inside that if, add another if: if item in player's main hand = (some type of axe) and item in player's main hand = (some type of axe) and so on until you reach all the axes in the game

After that, add these 3 ifs:

if get block direction at x y z = north or  get block direction at x y z = south

              Remove block at x y z

              Place (your stripped log) at x y z

              Set rotation of the block to North

if get block direction at x y z = west or  get block direction at x y z = east

              Remove block at x y z

              Place (your stripped log) at x y z

              Set rotation of the block to West

if get block direction at x y z = up or  get block direction at x y z = down

              Remove block at x y z

              Place (your stripped log) at x y z

              Set rotation of the block to Up

Additionally, you can add: "Play at x y z level: 1 pitch: 1 Sound: item.axe.strip" for the sound

Sorry, but I can't provide screenshots cause it doesn't work for some reason

Edited by DanilkaD on Sat, 08/22/2020 - 15:41