Open Trapdoor without redstone

Started by Antxi on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Open Trapdoor without redstone

Hello, so Im working on a new mod with a lot of features. Currently Im working on a structure that has trapdoors, so I created a new block and in block base I selected Trapdoor. When i try the block, it only opens with redstone but i can't open it with the hand (like the wooden trapdoors). I searched in the block properties and procedures and i didnt find any property to chose if it can be opened with the hand. Am I missing something or is just a feature that havent been added yet?

(Btw, sorry for my bad english. Im spanish XD)

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Post code. This is a snippet…
Sun, 05/31/2020 - 20:37

Post code. This is a snippet from the TrapDoorBlock code if it is of any help,

   public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult p_225533_6_) {
      if (this.material == Material.IRON) {
         return ActionResultType.PASS;
      } else {
         state = state.cycle(OPEN);
         worldIn.setBlockState(pos, state, 2);
         if (state.get(WATERLOGGED)) {
            worldIn.getPendingFluidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn));
         }

         this.playSound(player, worldIn, pos, state.get(OPEN));
         return ActionResultType.SUCCESS;
      }
   }