Jump to content

Help with World#isClientSide(), always returning true.


Recommended Posts

Posted
@SubscribeEvent
    public static void onClickEvent(InputEvent.ClickInputEvent event) {
        PlayerEntity player = Minecraft.getInstance().player;
        World world = Minecraft.getInstance().level;
        assert player != null;
        if(event.getKeyBinding().matchesMouse(0) && player.isHolding(ItemInit.ANDEN.get())) {   
            if(!world.isClientSide) {
                for(int i = (int) player.getY(); i > 0; i--) {
                    world.explode(player, player.getX(), i, player.getZ(), 5.5f, Explosion.Mode.DESTROY);
                }
            }
        }
    }

I've been trying all night to get this to work without leaving ghost blocks, but for some reason, world.isClientSide() always returns true, and I can't figure out why. 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.