Mod's stuff in a plugin?

Discussion in 'Spigot Plugin Development' started by wieczx, Jun 22, 2015.

  1. Hello.

    So yesterday I was trying to recognize an entity as a bullet from Flans Mod, i succeeded. Unfortunately that's not enough. I also need to check who's the shooter. I tried to import FlansMod into my project but I've got no idea how to connect bukkit's entity with net.minecraft.entity.Entity
    Would Craftbukkit help?
    Btw. I use Cauldron for that.
    I tried to do this by detecting a bullet when it spawns, but CreatureSpawnEvent won't work.

    Also, how to check left click an entity? It's not a mob but FlanMod stuff, like a cannon or a plane. Acts like an item frame, just breaks. Entity damage event won't record it.

  2. Hex

    IRC Staff

    Why are you trying to use a spigot plugin for this? Wouldn't it just be easier to make a forge mod? Anyways, (CraftPlayer)player).getHandle(). For the next bit, you need PlayerInteractEntityEvent.
  3. Cos I want to check if the bullet was shot by someone that belongs to the same guild as the defender. Team pvp. I use NovaGuilds plugin
  4. If you created an entirely new Entity with NMS than it gets kind of messy getting and checking the shooter but if you are simply firing an arrow quickly you can run EntityDamagebyEntityEvent, check if the entity and damager are players(the damager might be an arrow I forget) and then get the arrow involved and you can do "arrow.getShooter()". I think that solves your problem.
  5. Its not an arrow. It's a custom entity from a mod. That mod's api can tell me who's the shooter, but I don't know how to use it with bukkit
  6. Hex

    IRC Staff

    If you know the shooter, what do you need?
  7. I would know but I cannot cast bukkit's entity to EntityBullet wchich extends net.minecraft.entity.Entity (probably)

    Or I can't cast the shooter to bukkit's entity, don't remember

    I think it was the first one
  8. Hex

    IRC Staff

    Not sure how to do this with cauldron, but Entity.getBukkitEntity() might work?
  9. Cauldron works like bukkit+forge so thats not a problem.

    I don't know what this does but will try in the morning, thanks.
  10. Dude, how the hell could it be useful?