LittleTiles

LittleTiles

12M Downloads

ActionEvent and preventInteraction parameter

Protoxy22 opened this issue ยท 2 comments

commented

Hi, how can I disable the activation action of a LittleDoor (player's rightclicks) ?

I tried this:
From translation preventInteraction should be se to true if I want to disable the interaction.
After setting this parameter to true or false I didn't prevent the interaction.
I just want to totally block the activation of doors
Thanks

    @SubscribeEvent
    public void littleTileAction(final ActionEvent event) {
        if(event.action instanceof LittleActionActivated){
            Ravage.getLogger().info(((LittleActionActivated) event.action).uuid);
            ((LittleActionActivated)event.action).preventInteraction = false;
        }
    }

Console log:
TextComponent{text='TileEntity not found', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}

commented

You can disable allowRightClick in the door settings (in the recipe menu). If you want to disable it in the code set LittleDoor.disableRightClick to true.

commented

It doesn't work @CreativeMD
The doors animation is played while the door is still closed