Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Create falling sand entity, just like blockhunt

Comments in 'Plugin Development' started by wolfdale, Jun 7, 2015.

  1. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    How to create falling sand entity, just like blockhunt?
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Look at blockman plugin
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
  4. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You will have trouble handling resending chunks, because entities are unloaded when the player is too far or in another world, which you would find a lot of trouble handling. PocketMine handles everything perfectly. Why not use its API then?
  6. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    ok, so which method(addEntityPacketor physically spawning a Falling Sand Entity) should i use? can you give an example please?
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
  8. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    how do i prevent it from becoming a block? i want it to follow the player, just like blockhunt
    how to despawn/kill it?
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $entitiy->kill();

    BTW, it may be a better idea if you make another class that extends Living, have the network ID as that of falling sand and spawn with that class instead.
  10. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    Sorry, i dont quite understand you regarding here: "have the network ID as that of falling sand"
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Each non-abstract subclass of Entity (that will actually get constructed) has a class constant NETWORK_ID. Open some files like Arrow.php for example. That ID is actually the entity's ID. I was suggesting to declare another FallingSand class, but inheriting the Living or Human class and not implementing the physics of FallingSand.
    thebigsmileXD and wolfdale like this.
  12. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    Oh ok. Thanks for the detailed explanation!

Share This Page

Advertisement