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

FloatingText Information

Comments in 'Plugin Development' started by GamesLoad, Dec 16, 2015.

  1. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    Hello I wanted to know how you can put the number of coins and the number of money with Floating text this is my code
    PHP:
    $level->addParticle(new FloatingTextParticle($vect->add(0.50.0, -0.5),"Welcome to MGI""\n" "There are"$player "players""\n" "You have ".$money"money" "\n" "ggggg" "\n" "fffff")); 
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Adding the Particle to the world would mean that all players see the same, wouldn't it?
  3. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    They should not see each a different thing as the money
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    For each player, create a temporary storage (e.g. an entry in an array class property) that holds the instance of the particle. Every time the value has to be changed, use setText on the object and addParticle() again.
  5. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    ok you give me an example how do I do it for example that you reload the floating particle
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Simply addParticle again. What reload?
  7. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    for example when a player enters a player updates the variable $ players
  8. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    You want players to see diffrent content of particle?
    iDirtPlayzMC and CraftYourBukkit like this.
  9. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    i am very innterest in this thread, so @Primus what he wants is to display the money in the ftp(floatingtext particle) but in a private. like on xyz theres a ftp and i see my money there, if another players come they will see his instead of mine.

    This will be veryuseful if someone is kind and make such a plugin!
  10. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    foreach($players as $player) {
    $pk = new AddEntityPacket();
      
    $pk->eid $floatingTextParticle->getId(); // This probably wont work due to undefined method and $entityId is protected in that class
      
    $pk->type ItemEntity::NETWORK_ID;
      
    $pk->$floatingTextParticle->x;
      
    $pk->$floatingTextParticle->0.75;
      
    $pk->$floatingTextParticle->z;
      
    $pk->speedX 0;
      
    $pk->speedY 0;
      
    $pk->speedZ 0;
      
    $pk->yaw 0;
      
    $pk->pitch 0;
      
    $pk->item 0;
      
    $pk->meta 0;
      
    $pk->metadata = [
      
    Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE<< Entity::DATA_FLAG_INVISIBLE],
      
    Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, ("Hello ".$player->getName()."\n"."You have ".$player->getHealth()." hearts")],
      
    Entity::DATA_SHOW_NAMETAG => [Entity::DATA_TYPE_BYTE1],
      
    Entity::DATA_NO_AI => [Entity::DATA_TYPE_BYTE1]
      ];

    }
    CraftYourBukkit likes this.
  11. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    awesome :3

Share This Page

Advertisement