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

SpazzyTp

Comments in 'Plugin Development' started by Skullex, Jan 22, 2016.

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

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    You should be scared of him xD. (MWAHAHAHA *cough* MWAHAHAHA)
    Skullex and Vaivez66 like this.
  2. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    Skullex and TheDeibo like this.
  3. TheDeibo
    Offline

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    And were back.... .Hows the plugin @Skullex ?
  4. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Please STOP spamming. Look at THAT!

    "lol", "evil". WTH are you even talking about. If it is done, mark this as solved. A simple "Thanks for the help!" and a like will do.
    AndrewBit and Vaivez66 like this.
  5. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    still waiting to see if he got it working
  6. TheDeibo
    Offline

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    Stop all that yapping, lets start clapping. xD
    applqpak likes this.
  7. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    I just don't get why people do that.
  8. TheDeibo
    Offline

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    its a natural txt2speak reflex.
    (not picking on anyone now.. but people will just have to learn to deal with it.)
  9. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    Or some people will be banned ;)
  10. TheDeibo
    Offline

    TheDeibo Notable Member

    Joined:
    Sep 8, 2014
    Posts:
    693
    Minecraft User:
    TheDeibo
    nahhh...cfor a TxT2Speak feflex? nahhh.. people think its spam.... and people also think l33t (not he servers ) is spam. The fact is... look in the trophies. 1337 (l33t) is there.

    also, lets get back om subject
  11. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Well, I recently got done with an essay and I converted the compressed files into a .phar file, ran the command /pos and it says unknown error has occurred
  12. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Also it may be because I'm using TextFormat in the wrong places.. hm :|

    PHP:
    <?php

    namespace Spazzy;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Player;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\event\entity\EntityTeleportEvent;
    use 
    pocketmine\level\particle\PortalParticle;
    use 
    pocketmine\level\sound\EndermanTeleportSound;

    class 
    Main extends PluginBase implements Listener {

        public function 
    onEnable(){
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        }

        public function 
    onLoad(){
            
    $this->getLogger()->info("SpazzyTp §aenabled");
        }

        public function 
    onCommand(CommandSender $senderCommand $command$label, array $args){
            switch(
    $command->getName()){
                case 
    "pos":
                    if(
    $sender instanceof Player){
                        
    $playerX $sender->getX();
                        
    $playerY $sender->getY();
                        
    $playerZ $sender->getZ();

                        
    $outX=round($playerX,1);
                        
    $outY=round($playerY,1);
                        
    $outZ=round($playerZ,1);

                        
    $entityLevel $sender->getLevel()->getName();

                        
    $sender->sendMessage(TextFormat::BLUE " x:" TextFormat::GREEN $outX ", y:" TextFormat::YELLOW $outY ", z:" TextFormat::GREEN $outZ ". On: " TextFormat::AQUA $playerLevel);
                        return 
    true;
                    }

                    else{
                        
    $sender->sendMessage("§cThis command only works §ein§f-§egame.");
                }
            }
        }    

        public function 
    onTeleport(EntityTeleportEvent $event){
            
    $entity $event->getEntity();
            
    $fizz = new EndermanTeleportSound($entity);
            
    $particle = new PortalParticle($entity);
            
    $entity->getLevel()->addSound($fizz);
            
    $entity->getLevel()->addParticle($particle);
         }
       
        public function 
    onDisable(){
            
    $this->getLogger()->info("SpazzyTp §cdisabled.");
            return 
    true;
        }
    }
    plugin.yml

    Code:
    name: SpazzyTp
    main: Spazzy\Main
    version: "0.0.1"
    api: [1.0.0, 1.1.0]
    load: POSTWORLD
    author: Skullex
    commands:
     pos:
      description: gives you your coordinates
      usage: /pos
    
    What did I do wrong this time :eek: ???
  13. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Also @TheDeibo @PocketKiller @Vaivez66 @MichaelM04 @AndrewBit This plugin will play the sound on any type of teleportation. 'The EndermanTeleportSound' the player that teleports may not always hear it but if your just bystanding and a player just happens to vanish and enter into a 1vs1 or something then you'll hear that sound :) also in a way this is gonna be the revamped version of xyz and I'll add even better stuff in the future but for now I need assistance!!! :)
  14. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Error in console?
  15. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    No, error in chat when you run the command. I made it so that it can't be run through console ;-;
  16. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    I mean, console will report an error if you had 'An error has occurred'
  17. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Yeah I guess, am I supposed to check that? Or :eek:
  18. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Yeah, I guess
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Or just get an IDE and reformat the code. Or read the errors.

    If you have 100 ifs in your function, you'd better separate them into functions.
    Skullex likes this.
  20. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    I got this

    Code:
    [Server] [03:06:09] [CRITICAL]: Unhandled exception executing command 'pos' in pos: Undefined variable: playerLevel
    [Server] [03:06:09] [NOTICE]: UndefinedVariableException: "Undefined variable: playerLevel" (E_NOTICE) in "/SpazzyTp.phar/src/Spazzy/Main" at line 39
    
Thread Status:
Not open for further replies.

Share This Page

Advertisement