Open Trapdoor without redstone

Started by Antxi on Thu, 05/28/2020 - 10:15

Topic category: Help with modding (Java Edition)

Last seen on 18:13, 17. Jun 2020
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Open Trapdoor without redstone
Thu, 05/28/2020 - 10:15

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)

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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;
      }
   }