A weird problem with fallingblocks riding a player

Discussion in 'Plugin Development' started by OracleTarget, Aug 21, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    OracleTarget

    Hey guys,

    Today I was messing around with fallingblocks riding players and discovered a some kind of bug (well not really a bug, but I have no better word
    to describe to problem). Letting fallingblocks ride a player works perfect, but when the player directly walks off a block to a block 1 y lower, the fallingblocks suddenly become solid blocks. However jumping from the block to the block 1 y lower just works fine and the fallingblocks won't become solid blocks.

    Do you have a solution for the problem?
    Thanks :D

    In case you want to see the code:
    Code:
                FallingBlock b = (FallingBlock) p.getWorld().spawnFallingBlock(p.getLocation().add(0, 2, 0), Material.WOOL, (byte) 6);
                FallingBlock b2 = (FallingBlock) p.getWorld().spawnFallingBlock(p.getLocation().add(0, 2, 0), Material.WOOL, (byte) 8);
               
                b.setDropItem(false);
                b2.setDropItem(false);
               
                p.setPassenger(b);
                b.setPassenger(b2);
     
  2. which events are thrown? maybe one event sets it to a solid blog because it's passenger drops away idk xD this is a very wierd bug :O
     
  3. Offline

    OracleTarget

    Shmobi
    At least I found out the BlockPhisicsEvent gets called, buts thats not really the one that works for me
     
  4. Offline

    mythbusterma

    OracleTarget

    Not really a bug, the falling block hits the ground behind the player if you just walk off a ledge, and as such, becomes a solid block.
     
  5. Offline

    OracleTarget

    mythbusterma
    Okay... I think that brings me closer to the solution
     
  6. OracleTarget save the block into a variable or a list and listen to the event, which is called when the block is falling down. check if it is the block you ve saved and if so set the passenger again and cancel the event. looks maybe a little bit weird but what do you want? you're riding a player with a falling block xD
     
Thread Status:
Not open for further replies.

Share This Page