FallingBlock Location Problem

Discussion in 'Plugin Development' started by etaxi341, Sep 26, 2013.

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

    etaxi341

    Hey Coders out there! I have one problem. If you spawn a FallingBlock it will always spawn in the middle of the block. Even if the Location is something like that: x = 0.2, y = 0 and z = 0. But it will always remove the commas and translate this example to this: x = 0, y = 0 and z = 0. So It will always spawn in the center.
    Code:java
    1. FallingBlock fb = getLocation().getWorld().spawnFallingBlock(location, material, damagevalue);

    Thank you for your Help :)
     
  2. Offline

    chasechocolate

    Try teleporting it after you spawn it.
     
  3. Offline

    etaxi341

    chasechocolate I have already tried this. Doesn't work either. And I cannot wait one tick to teleport because this one only lives for 1 tick.
     
  4. Offline

    Techy4198

    I have similar problems, but slightly different. I want to change the block data of the entity while it is moving, but I do it by removing, and spawning with new data, but then this happens. is there a way I can modify the block id/data of an existing Falling Block entity?

    if you want to see what I mean, download my MiscBukkit plugin, enable throwing blocks in the config, hold any block, and type
    /throw 1.5 -r
     
  5. Offline

    Garris0n

    Have you tried using .spawn() instead? Perhaps spawnFallingBlock intentionally puts it in a block.
     
  6. Offline

    nisovin

    Bukkit does, in fact, do this. It also does the same thing in the spawn() method.
     
  7. Offline

    Garris0n

    That's so pointless...hmm...I'm a bit too busy to check for it but perhaps there's an NMS method to spawn them...correctly.
     
Thread Status:
Not open for further replies.

Share This Page