Posted August 22, 20241 yr ok so im trying to make a telescopic sight block, ive heard i need a entity to be used as the camera/renderer, i can get the entity spawning and UUID saving functional, but i cant seem to find a way to get the entity back with its UUID ive searched a lot but all the methods i found seems to use the World class, which doesnt seem to be in 1.20 saving (zombie is a placeholder) if (!level.isClientSide()){ BlockEntity BE = level.getBlockEntity(pos); if(BE instanceof ScopeEntity blockEntity){ Entity entity = new Zombie(EntityType.ZOMBIE, level); entity.moveTo(pos.getX() + 0.5f, pos.getY() + 1, pos.getZ() + 0.5f); level.addFreshEntity(entity); blockEntity.saveID(entity.getUUID()); } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.