Help With Color Effects!

Discussion in 'Plugin Development' started by candyfloss20, May 22, 2014.

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

    candyfloss20

    So i want ops to have colors effects from potions on them but WITHOUT giveing them the effect!
    this is what i have so far but how do i add the partials with out the effects:

    Code:java
    1. package com.xcraft.core.PlayerBased;
    2.  
    3. import org.bukkit.entity.Player;
    4. import org.bukkit.event.EventHandler;
    5. import org.bukkit.event.Listener;
    6. import org.bukkit.event.player.PlayerMoveEvent;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9. public class PlayerEffects extends JavaPlugin implements Listener {
    10.  
    11. @EventHandler
    12. public void onMove(PlayerMoveEvent e) {
    13. Player op = e.getPlayer();
    14. if (op.isOp()) {
    15. //add effect here
    16. }
    17. }
    18. }


    Regards candyfloss20
     
  2. Offline

    mine-care

    Τhis will be hard because it uses packets and also packets are not good for your server.. you essentialy inject packets in normal server stream... And why not using the already existing Player.playeffect(Effect); there is mobspawner flames, smoke ect...
     
  3. Offline

    candyfloss20

    @mine-care
    yes but you could catch and remove the Exceptions so is there a way ?
    eg: like this:
    Code:java
    1. try {
    2. NametagAPI.setPrefix(e.getPlayer().getName(), ChatColor.DARK_RED + "§l[Owner] " + ChatColor.GREEN);
    3. }
    4. catch (NullPointerException el) {
    5. el.printStackTrace();
     
  4. Offline

    AstramG

    mine-care
    Since when have packets been not good besides version updating?
     
    candyfloss20 likes this.
  5. Offline

    candyfloss20

    AstramG
    I agree with out :)
    i hade no problems with send packets before just need to know how to do it this aspect of Bukkit
     
  6. Offline

    fireblast709

    ProtocolLib :3
     
    Rocoty and candyfloss20 like this.
  7. Offline

    tomudding

  8. Offline

    candyfloss20

    tomudding, I did try this before I asked you guys.
    it error out a lot and I could not import most of the packets think its because its from 2012 :)
    any other ways (how would I use ProtocolLib to do it) ?
     
Thread Status:
Not open for further replies.

Share This Page