Disguise mod as other mob

Discussion in 'Plugin Development' started by nubebuster, Oct 28, 2014.

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

    nubebuster

    I tried to disguise a silverfish as a chicken.
    I tried this code which works with players to mobs, but not with mobs to mobs
    Code:java
    1. EntityChicken toSpawn = new EntityChicken(
    2. ((CraftSilverfish) event.getEntity()).getHandle().world);
    3. toSpawn.setAge(0);
    4. toSpawn.locX = event.getLocation().getX();
    5. toSpawn.locY = event.getLocation().getY();
    6. toSpawn.locZ = event.getLocation().getZ();
    7. for (Player b : Bukkit.getOnlinePlayers()) {
    8. ((CraftPlayer) b).getHandle().playerConnection
    9. .sendPacket(new PacketPlayOutEntityDestroy(
    10. (((CraftSilverfish) event.getEntity()).getHandle()
    11. .getId())));
    12. ((CraftPlayer) b).getHandle().playerConnection
    13. .sendPacket(new PacketPlayOutSpawnEntityLiving(toSpawn));
     
    DuskFireHD likes this.
  2. Offline

    Watto

    What happens? What doesn't happen? Any errors in console?
     
  3. Offline

    Deleted user

  4. Offline

    nubebuster

    I want code, not a plugin Joiner
     
  5. Offline

    mythbusterma

    nubebuster

    That's an API you can use to fake the appearance of mobs.
     
  6. Offline

    nubebuster

    mythbusterma I dont want to use a whole plugin for three lines of code...
     
  7. Offline

    Deleted user

    You have to.

    Evidently, 3 lines of code are not enough if there is a whole plugin.

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

    nubebuster

    Joiner
    3 lines * 69 mobs = 207 lines. All the code I already have is already neccesairy and using a seperate plugin woulb multiply about 500 lines.
    Which means alltogether this adds 707 lines which are waste. Looks like minecraft 1.8.
     
  9. Offline

    DuskFireHD

    @nubebuster How did you disguise the players as a mob?
     
  10. Offline

    nubebuster

    Same code but then other destroy packet, i hope you can figure it out using ctrl space
     
  11. Offline

    DuskFireHD

    @nubebuster Do you think you can post the code for disguising the player as a mob because I don't really know how to use packets and all that stuff Please I beg you XD
     
Thread Status:
Not open for further replies.

Share This Page