HomeJavaModsBetter Cushion Placement
Better Cushion Placement
ModsJava

Better Cushion Placement

by Phylogeny · on Modrinth

Cushions snap to the pixel grid or block grid, stack on one another, & render a placement preview. With game rules, they support one another with no block…

⬇ Download on Modrinth
Better Cushion Placement — screenshot 1Better Cushion Placement — screenshot 2Better Cushion Placement — screenshot 3Better Cushion Placement — screenshot 4Better Cushion Placement — screenshot 5Better Cushion Placement — screenshot 6Better Cushion Placement — screenshot 7Better Cushion Placement — screenshot 8

Visual Summary

Cushion Placement



Placement Mechanics

Block GridVertical Pixel Grid Snap: On

Holding Shift


Pixel Grid

Holding Control


Off-Grid

Holding Shift + Control


Block Center

Holding neither (Vanilla behavior)



Placement Preview

Cushion Placement Preview

A box renders where a cushion will place with the color it will have when placed.



Block Tags



Configs

Folder: config/bettercushionplacement/

Config Screen

Config GUI

Client Config bcp-client.conf

Placement Preview: Configures how to render a placement preview box for cushions

Common Config bcp-common.conf

Game rule features (Cushions Support Each Other and Snap Cushion Elevation To Pixel Grid, see below) can be set to always enabled or always disabled in the bettercushionplacement-gamerules.properties file in the config folder.



Game Rules

Stack cushions directly on one another without block support

Background Explanation

Vanilla cushion support is as follows Cushion_wouldSuriveAt:

If no block support is found, this game rule additionally checks for other cushion entities below it, and considers it supported if one is found.


Flush placement w/o datapack Close to flush via a sign
Cushion Flush With Block Cushion Almost Flush With Block

Bypass block tags for inner wall sub-pixel placement with a game rule

Background Explanation

Vanilla block interaction behavior is as follows BlockGetter_clipWithInteractionOverride:

Blocks by default have no interaction shape BlockBehaviour_getInteractionShape, with the following exceptions:

Whether returning a full block shape or just the inner void shape, all of these blocks have interactions shapes with solid flat tops flush with the top of the block space.

Composter interaction shape Hopper interaction shape
Composter Interaction Shape Hopper Interaction Shape

The only way to get a raytrace hit on the inner walls of the shapes of these blocks is to get an even closer hit on the top face of their interaction shapes. This means that any inner hit will have the expected inner location vector, but with a direction of Direction.UP. So although cushions require interacting with an upward face CushionItem_useOn#L38, these blocks uniquely bypass this requirement.

While sub-pixel placement is still possible (on signs WallSignBlock_SHAPES, for example), placement on horizontal faces and arbitrary Y positioning was not intended. This is why Mojang added the #cushion_uses_collision_shape block tag, which forces the use of the collision shape raytrace result CushionItem_recalculateContextForSpecialCollisionShapes#L81-88.

Wall collision placement Soul Sand collision placement
Wall Collision Placement Soul Sand Collision Placement

Note that raytrace is from the eyes L84 to the slightly past the exiting hit result vector L85-86, and that hit failure defaults to the original hit result L88. This means that when a collision shape hit is closer to the eyes than the main shape hit, as with wall blocks WallBlock_collisionShapes, the collision shape will be used. But when the main shape hit is closer, as with soul sand blocks SoulSandBlock_SHAPE, the main shape will be used in spite of having the tag.



Server-only Installation

If this mod is installed on a server, but not a client, everything will work as intended, with the following purely visual exceptions:

  1. The player's hand will swing
    • Even when cushion placement fails due to intersection with an existing cushion.
  2. The player's hand will not swing
    • When placing a cushion on the inner wall of a cauldron, composter, or hopper.
    • When stacking a cushion on another cushion.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more