DisguiseCraft API - Turn player into Block

Discussion in 'Plugin Development' started by schotobi, Jul 29, 2014.

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

    schotobi

    Hello,

    currently i'm working with the DisguiseCraft API. I have no problems to turn a player into a Mob (Wolf, Spider, etc.). Now i want to change the player into a Block. In the API this is named as a "FallingBlock" (DisguiseType.FallingBlock), but i don't know how i set a player into a specific block (e.g. Stone). The default block is sponge.

    Code:java
    1. DisguiseCraft.getAPI().disguisePlayer(player, new Disguise(DisguiseCraft.getAPI().newEntityID(), DisguiseType.FallingBlock));

    When i'm using the code above the player turns into a sponge by default.

    I thank anyone who can help me!

    Best Regards,
    schotobi
     
  2. Offline

    Devil Boy

    DisguiseCraft is still behind and identifies block types by their ID (a magic number).

    Using the FallingBlock entity is correct, but to change the type of block it gets rendered as, you need to add some metadata to it.

    Here's an example.
    Code:java
    1. DisguiseCraft.getAPI().disguisePlayer(player, new Disguise(DisguiseCraft.getAPI().newEntityID(), "blockID:<idgoeshere>",DisguiseType.FallingBlock));


    It will likely be changed to accept block names as well, but in the end, DisguiseCraft really need a massive overhaul. I just need to find the time for it.
     
Thread Status:
Not open for further replies.

Share This Page