Solved How do I spawn a custom entiy without overriding the base version?

Discussion in 'Plugin Help/Development/Requests' started by Zombie_Striker, Apr 25, 2015.

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

    Zombie_Striker

    I am using this tutorial to change the way a mine cart is driven:
    http://bukkit.org/threads/tutorial-1-7-5-wasd-entity-riding.163019/

    The thing is I don't want to override all mine carts on the server, So I can't use his register method. I set up my own custom class now, but it takes in the "v1_8_R1 World", which I do not know how to get from a player.

    Does anyone have an idea of how I would get this, and if there is no way to get it, how would I go about spawning my custom entity without changing all mine carts on the server.
     
    Last edited: Apr 25, 2015
  2. I think its world.getHandle()
     
  3. Offline

    Zombie_Striker

    getHandle() does not come up, so I don't think the method exists for org.bukkit.world; or for the 1_8_R1World
     
  4. Offline

    xTrollxDudex

    Cast the player's world to CraftWorld and get the handle of CraftWorld.
     
  5. Offline

    Zombie_Striker

    @xTrollxDudex I did that, but now I it causes a new error. How would I spawn my custom Entity without replacing the base version of that entity. Is there a way to remove an entity, such as Endermite, and change it to the custom Entity?
     
  6. Offline

    xTrollxDudex

    @Zombie_Striker
    I'm unsure of how registration works, but you could create a new instance of the entity, register, spawn it into the world using the world handle, and register the normal type to override the last one.
     
  7. Offline

    Zombie_Striker

    I'm going to mark this as solved. I realized I could just replace an Endermite instead of messing around with registration.
     
Thread Status:
Not open for further replies.

Share This Page