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

Solved How to fix this error?

Comments in 'Plugin Development' started by CaptainKenji17, Feb 17, 2016.

  1. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    Code:
    [Server thread/NOTICE]: InvalidArgumentException: "Argument 1 passed to pocketmine\level\particle\FloatingTextParticle::__construct() must be an instance of pocketmine\math\Vector3, string given, called in C:\Users\CaptainKenji17\Desktop\PocketMine-MP\plugins\NBS\src\PlayNoteBlockSong\PlayNoteBlockSong.php on line 189 and defined" (E_RECOVERABLE_ERROR) in "/src/pocketmine/level/particle/FloatingTextParticle"
    
    PHP:
                $this->song = clone $this->songs[$this->index][self::SONG];
                
    $vect2 = new Vector3(25243120);
                
    $vect2 = new FloatingTextParticle("§ePlaying now: " $this->songs[$this->index][self::NAME]);
    "Learn PHP" are blocked word on this thread, try to say it ill block you
  2. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Blabla, ImagicalGamer and Muqsit like this.
  3. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    __construct argument 1 should be a instance of Vector3.
    PHP:
    new FloatingTextParticle(new Vector3($x,$y,$z), $text);
    And, I recommend you check how constructors and destructors work, it will be so helpful for you.
    http://php.net/manual/en/language.oop5.decon.php
  4. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Muqsit, PocketKiller and applqpak like this.
  5. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    well let me ask you this if you learn PHP you wouldn't be here right now asking this would you?
  6. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    [Server thread/CRITICAL]: Unhandled exception executing command 'song play' in song: Undefined variable: x
  7. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    Ive fixed this error but still it doesnt show the particle ;(

    PHP:
    $vect2 = new FloatingTextParticle(new Vector3(25243120), "§ePlaying now: " $this->songs[$this->index][self::NAME]);
  8. CookieSteve
    Offline

    CookieSteve Active Member

    Joined:
    Apr 22, 2014
    Posts:
    132
    Minecraft User:
    iStrqfeChris
    Learn PocketMine Api
    applqpak likes this.
  9. CookieSteve
    Offline

    CookieSteve Active Member

    Joined:
    Apr 22, 2014
    Posts:
    132
    Minecraft User:
    iStrqfeChris
    PHP:
    $vect2 = new FloatingTextParticle(new Vector3(25243120), "§ePlaying now: " $this->songs[$this->index][self::NAME]);
    [/QUOTE]
    Where's the Code 2 Spawn the Particle?
  10. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    Where's the Code 2 Spawn the Particle?[/QUOTE]
    Learn 2 code
  11. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    Im outta this particle, ill try it on sign instead, thanks for helping. bye
  12. CookieSteve
    Offline

    CookieSteve Active Member

    Joined:
    Apr 22, 2014
    Posts:
    132
    Minecraft User:
    iStrqfeChris
    Learn 2 code[/QUOTE]
    that doesnt spawn it it just defines it
  13. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    that doesnt spawn it it just defines it[/QUOTE]
    how do you spawn it then
  14. CookieSteve
    Offline

    CookieSteve Active Member

    Joined:
    Apr 22, 2014
    Posts:
    132
    Minecraft User:
    iStrqfeChris
    Code:
     $level->addParticle($vect2); 
    CaptainKenji17 likes this.
  15. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    still not spawn it :(
    PEMapModder likes this.
  16. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Spawn it on PlayerRespawnEvent or/and PlayerJoinEvent
    CaptainKenji17 likes this.
  17. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    cnt it be in CommandEvent? oh kk
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Nope. You can spawn it anytime, including during command dispatch.
    Syntaxious likes this.
  19. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    It is removed at a rejoin though, isn't it?
  20. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes.

    But still, it doesn't mean you can't do that; maybe that's the expected behaviour. ;)

Share This Page

Advertisement