Library EffectLib - Manage your effects the nice way. (Text/Image in Particles)

Discussion in 'Resources' started by Slikey, Apr 21, 2014.

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

    LCastr0

    Why would holograms be used in this? Sorry, I don't get your point... Can you explain?
     
  2. Offline

    AKZOBIE74

    LCastr0 It's a spell if you remember Harry Potter and The Goblet of Fire when Harry is in that maze he casts a spell that shoots a red spark out of his wand and into the sky i was wondering if you could do that but the Hologram would say Help so players from all directions can see it because a Hologram follows your view in the holographic displays plugin so ya.
     
  3. Offline

    LCastr0

    The players would only see the hologram, not the effect...
     
  4. Offline

    AKZOBIE74

    LCastr0 so can't you make it so that a effect goes upwards for a limited amount of time and then the hologram pops up with a spark and then the hologram goes away for 5 seconds?
     
  5. Offline

    LCastr0

    No I didn't mean that...
    Particles are visible only in a range (In most of the cases (almost all of them), 16 blocks from the player, they cannot see it anymore). Holograms are applicable to entities, not to particles (Of course, I can spawn it in the particle location...), but that would not make the particle be visible in a bigger range, you would only be able to see the hologram
     
  6. Offline

    AKZOBIE74

    ok thats fine could you please make it? LCastr0
     
  7. Offline

    dNiym

  8. Offline

    LCastr0

    dNiym likes this.
  9. Offline

    LihP

    Can some one please share an example of how to customize a text effect.
    Code:
                    EffectLib lib = EffectLib.instance();
                    EffectManager em = new EffectManager(lib);
                    Effect effect = new TextEffect(em);
                   
                    effect.setLocation(Bukkit.getWorld("world").getSpawnLocation().clone().add(0.5D, 10D, 0.5D));
                   
                    effect.infinite();
                   
                    effect.start();
    If you use the latest build of spigot http://www.spigotmc.org/threads/spigot-update-20141001a.31047/

    http://dev.bukkit.org/bukkit-plugins/holographic-displays/
    <Edit by Moderator: Redacted not allowed paid resource url>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 24, 2019
  10. Offline

    LCastr0

    effect.text = "Your text"; (Put before effect.start(); )

    I still don't get what you want me to do...
     
  11. Offline

    Trolltheking

    i can't download the plugin from the third post ;(
     
  12. Offline

    LihP

    I tried that before posting, you cannot access "text" though the effect variable.
     
  13. Offline

    LCastr0

    Oh, you created it as Effect class, not TextEffect
    use
    TextEffect effect = new TextEffect(em);

    I told Slikey, I think he is going to fix soon. Sorry for that

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  14. Offline

    LihP

    Durp, thanks for pointing that out its been driving me crazy!
     
  15. Offline

    LCastr0

    Link fixed.
     
  16. Offline

    LihP

    One quick question please, I would like the particles to be visible from more than 16 blocks, I know most particles do not render past this but some do. Particles like the block break and part of the firework do render over 16 blocks, I have tried setting the "visibleRange" while using the FIREWORKS_SPARK but it doesn't change the render distance, any suggestions?
     
  17. Offline

    LCastr0

    Hmm it should be working if you set the visibleRange...
    What is the code you're using?
     
  18. Offline

    LihP

    The code is just a default TextEffect which uses the fireworks_spark as default and I set the visibleRange to 100 at first and increased it to 400 but didn't see any difference.
     
  19. Offline

    LCastr0

    Don't use 100 or 400... I think the max of a firework is something like 50 or 75. I'll check and tell you.
    #Edit
    The Firework Sparks seems to be 16 blocks only, at least using the /particle command in 1.8.
    http://imgur.com/OSk8n6N,i2UfqAD
     
  20. Offline

    AKZOBIE74

    I want it when you cast a spell it shoots a magic crit into the sky and then where the magic crit stops an explosion happens and it creates the words in text "Help" also can you add a Red color to the text?
     
  21. Offline

    ItzFeff890

    Slikey
    Im so confused here.
    Do I implement it from Java Build Path or do I have to manually copy and paste the class I need?
    Also, after that. What do I do?? D:
    Can someone out there please make a youtube tutorial or something? I am a visual learner.
     
  22. Offline

    LCastr0

    Implement it just like you do with CraftBukkit.
    After that, the examples on the second post should help you... I will try to do something like a text tutorial with images
     
  23. Offline

    ItzFeff890

    Hmm, still not working.
    Code:
    package com.christmas.particles;
     
    import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles;
     
    import org.bukkit.Location;
    import org.bukkit.entity.Entity;
     
    import de.slikey.effectlib.EffectManager;
    import de.slikey.effectlib.EffectType;
    import de.slikey.effectlib.particle.ParticlePacket.ParticleType;
     
    public class FlameEntityEffect extends EntityEffect{
        public FlameEntityEffect(EffectManager effectmanager, Entity entity){
            super(effectmanager, entity);
            type = EffectType.REPEATING;
            period = 1;
            iterations = 600;
        }
        @Override
        public void onRun(){
            for(int i = 0; i < 10; i ++){
                Location location = entity.getLocation();
                location.add(RandomUtil.getRandomCircleVector().multiply(RandomUtil.random.nextDouble() * 0.6d));
                location.add(0, RandomUtil.random.nextFloat() * 2, 0);
                PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(ParticleType.FLAME.getParticleName(), (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 0);
                sendPacket(packet, location, visibleRadiusSquared);
            }
        }
    }
    That's what I have done but I get errors on pretty much every line.
    LCastr0
     
  24. Offline

    LCastr0

    Oh no, no... Are you trying to create a new Effect or use a pre-existing one?
     
  25. Offline

    Trolltheking

    How do you make the tornado effect follow you?
     
  26. Offline

    LCastr0

    Something like this:
    Code:
    TornadoEffect effect = new TornadoEffect(manager);
    effect.setEntity(<your player entity>);
    //anything else you want to set in your effect
    effect.start();
    
     
  27. Offline

    ItzFeff890

    LCastr0
    Trying to make an existing one.
    To be exact I would like the helix made out of flames.
     
  28. Offline

    LCastr0

    You don't need to create a class of the Effect for that.
    Lets say you want to spaan it when a player runs a command:
    Code:
    //your code of the command
    Player player = (Player) sender;
    //assuming that you have an EffectManager already
    HelixEffect helix = new HellixEffect(manager);
    helix.setEntity(player);
    //anything else you want to use on the effect
    helix.start();
    //the rest of your command code
    
     
  29. Offline

    Trolltheking

  30. Offline

    ItzFeff890

    Okay! I get how you make the effect but I need a manager. I have no idea how to make one D:
    I've tried
    Code:java
    1. EffectManager manager = new EffectManager();
    in the onEnable() but that didn't work.
    LCastr0
     
Thread Status:
Not open for further replies.

Share This Page