Spawn a creeper that looks like a zombie

Discussion in 'Spigot Plugin Development' started by Alex0589, Jul 11, 2019.

  1. Hi,
    I would like to know if there is any way to spawn a creeper that behaves just like a normal creeper, but that looks like a zombie.
  2. Make a runnable and check if any players are near that zombie, if that's the case summon an explosion on the zombie's location.
  3. Maybe making the creeper invisible and teleporting the zombie to the creeper somehow would work, though i have no idea how as i've never really tried anything like this.
    • Creative Creative x 1
  4. You'd probably have to make a new Zombie object, then listen for a bunch of events that pertain to that specific zombie, and as Strum said, spawn an explosion, however if you want a more genuine creeper you'd probably have to do things such as timers for explosion, cancellation of explosion if the player backs away or gets behind cover (like a normal creeper) and even things like sound.

    EDIT: Wasn't considering any kind of packet manipulation, just using purely the api and zombie textures as close as you can get (imo)
    #4 Oscazz, Jul 11, 2019
    Last edited: Jul 11, 2019
  5. It’s very possible. If you want to accomplish this just how you say, you’ll have to work on the packet level. You are going to have to intercept spawn packets and manipulate entity type IDs.

    LibsDisguises does this. Use their API, or research their implementation of it.
  6. could use libdisquises and use the api to disquise a creeper as a zombie
  7. You could change the entity type in the SpawnPacket of the Creeper (you can check if the entityId of the Bukkit's creeper and of the packet's creeper are the same) and then change it to the zombie entity type.

    Also change the entity metadata of the MobSpawn packet.

    Now you only have to intercept the packets that are related to the creeper and not to the zombie, as the EntityMetadata packet.

    As packet API I suggest you either ProtocolLib or my PacketInjectorAPI.