mojira.dev
MC-222794

Cannot place end crystals in the same place as light block

The bug

End crystals cannot be placed at positions occupied by light blocks.

How to reproduce

  1. Place bedrock

  2. Place a light block on top

  3. Attempt to place an end crystal on the bedrock
    ❌ The end crystal cannot be placed

Expected results

The end crystal would be able to be placed, which would be consistent with other entities like armor stands and boats.

Linked issues

Attachments

Comments 17

Can't you only place them on obisidan and bedrock?

Not on, in the same place as.

Can confirm in 21w15a.

Can confirm in 21w16a.

7 more comments

I can confirm this behavior in 1.18.2. Here's a code analysis of this issue.

Code Analysis:

The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.

net.minecraft.world.item.EndCrystalItem.java

public class EndCrystalItem extends Item {
   ...
   public InteractionResult useOn(UseOnContext $uoc) {
      Level level = $uoc.getLevel();
      BlockPos blockpos = $uoc.getClickedPos();
      BlockState blockstate = level.getBlockState(blockpos);
      if (!blockstate.is(Blocks.OBSIDIAN) && !blockstate.is(Blocks.BEDROCK)) {
         return InteractionResult.FAIL;
      } else {
         BlockPos blockpos1 = blockpos.above();
         if (!level.isEmptyBlock(blockpos1)) {
            return InteractionResult.FAIL;
         } else {
            ...

If we look at the above class, we can see that the code specifically checks to see whether or not the block above the desired placing location is empty (is air), before being able to place down an end crystal. This is evident through the following line of code:

if (!level.isEmptyBlock(blockpos1))

Since a light block isn't considered as air, the placement attempt fails, resulting in end crystals not being able to be placed in the same space as light blocks.

This seems intentional to me, or you could remove light blocks in survival by placing the end crystal, destroying it and removing the fire.

Can confirm in 22w11a. Relates to MC-201351.

Can confirm in 1.19.

Can confirm in 1.19.2.

Dmitry Konev

(Unassigned)

Confirmed

Platform

Low

Block states

end_crystal

21w14a, 21w15a, 21w16a, 21w17a, 21w19a, ..., 1.20.1, 23w32a, 23w33a, 23w35a, 1.20.4

Retrieved