The function GameTestAssertPosException assertionException(BlockPos pos, Component description) in GameTestHelper class can receviced incorrect value. According to the definition of the GameTestAssertPosException class, the parameter pos is the relative coordinate. But in some entity-related function, It return the absolute coordinate of the entity as relative coordinate, like assertEntityData() and assertEntityProperty().
Therefore, we can imagine that if the relative coordinates of the entity we are expected are [0, 2, 2], and the coordinates of test instance block are [4, 0, 0]. In this case, the entity coordinates, also as relative coordinates, are [4, 3, 3] , the game will render error marker and error message on [8, 4, 4], although wa expect them are rendered on [4, 3, 3].
Attached image is my local test result.
(helper) -> { helper.succeedWhen(() -> helper.assertEntityData(new BlockPos(0, 2, 2), EntityType.VILLAGER, LivingEntity::isSleeping)); }This behavior don’t affect normal gameplay, but may confuse some mod creater. Considering that this is a vanilla game behavior, I think it's worth to report it .
Thank you for helping us improve Minecraft! We saved your files: