tutorial:directionalblock
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:directionalblock [2024/08/26 01:28] – [Making a Directional Block] solidblock | tutorial:directionalblock [2024/12/08 14:04] (current) – [Influence path finding] typo solidblock | ||
---|---|---|---|
Line 105: | Line 105: | ||
===== Defining rotation and mirroring of blocks ===== | ===== Defining rotation and mirroring of blocks ===== | ||
For directional blocks, you may have to override '' | For directional blocks, you may have to override '' | ||
+ | |||
+ | ===== Influence path finding ===== | ||
+ | If you place these blocks in game, you may find the issue that, the mobs when trying to find paths, will try to cross the blocks, as if the blocks did not exist, ending up being blocked by the blocks. That's because mobs treat such non-full-cube blocks as those not blocking their path. To modify this path-finding behavior, you need to override '' | ||
+ | <code java> | ||
+ | @Override | ||
+ | protected boolean canPathfindThrough(BlockState state, NavigationType type) { | ||
+ | return false; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | In vanilla, some blocks have different path node types. For example, mobs will avoid some dangerous blocks, such as magma block, wither rose and cactus. You can also make mobs treat your blocks differently, | ||
===== Next ===== | ===== Next ===== | ||
Try to make it [[waterloggable]]. | Try to make it [[waterloggable]]. |
tutorial/directionalblock.1724635736.txt.gz · Last modified: 2024/08/26 01:28 by solidblock