Custom Wither Skull and Rotation

Discussion in 'Plugin Development' started by DevRosemberg, Sep 23, 2014.

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

    DevRosemberg

    Hey everyone, im having trouble creating a Custom Wither Skull that makes a spiral as it flies. I was told by Slikey to use his Cone Effect Code and to make a Custom Wither Skull and clear its movement which i did here:

    Code:java
    1. public class CustomSkull extends EntityWitherSkull {
    2. public CustomSkull(World world) {
    3. super(world);
    4. }
    5.  
    6. @Override
    7. public void h() {}
    8.  
    9. @Override
    10. public void move(double d0, double d1, double d2) {}
    11.  
    12. @Override
    13. public void collide(Entity entity) {}
    14.  
    15. @Override
    16. public void g(double d0, double d1, double d2) {}
    17. }
    18.  


    Now the problem is that i cannot register this entity as it does not extend EntityInsentient. The second problem is that using this code:

    Code:java
    1. new BukkitRunnable() {
    2. Location location = spawnLoc;
    3. int step = 0;
    4. @Override
    5. public void run() {
    6. for (int x = 0; x < 10; x++) {
    7. if (step > 180) {
    8. step = 0;
    9. }
    10.  
    11. double angle = step * angularVelocity;
    12. float radius = step * 0.006f;
    13. float length = step * .05f;
    14.  
    15. Vector vector = new Vector(Math.cos(angle) * radius, length, Math.sin(angle) * radius);
    16. VectorUtils.rotateAroundAxisX(vector, (location.getPitch() + 90) * degreesToRadians);
    17. VectorUtils.rotateAroundAxisY(vector, -location.getY() * degreesToRadians);
    18.  
    19. location.add(vector);
    20. skull.teleport(location);
    21. location.subtract(vector);
    22. step++;
    23. }
    24. }
    25. }.runTaskTimer(this, 0L, 1L);


    The wither skull does not rotate (the normal one). I was wondering if anyone could help me, thanks in advance.
     
  2. Offline

    FabeGabeMC

    DevRosemberg
    Maybe create a List storing the skull's UUID?
     
  3. Offline

    DevRosemberg

    FabeGabeMC What? Why would i need to do that?

    bigteddy98 told me that its not necessary to register an entity not extending the EntityInsentient class so the only problem i have now is the second one.
     
  4. Offline

    FabeGabeMC

    DevRosemberg
    Ah, I see.
    I was just saying you could add those, with the certain edit you gave, to the list.
     
  5. Offline

    DevRosemberg

    FabeGabeMC I got it working, i was informed that WitherSkulls are broken on 1.8 and got with a better alternative to them but eitherway the spawnLoc seems to be off some times.
     
Thread Status:
Not open for further replies.

Share This Page