When creating a new potion effect to apply to an entity, the potion's ID is the first parameter, hence potionPoison.id. The second bit, although it looks complicated in that line, is merely how long it will last for. A higher integer means it will last longer. The final parameter is the amplifier to apply to it. In theory it should mean a stronger potion that deals the damage more quickly, but I haven't had a chance to tinker with it. Since I'm assuming your darts will act a lot like arrows, include that line of code in the same place you deal the damage to the entity you hit. Whether it's before or after shouldn't matter.
When creating a new potion effect to apply to an entity, the potion's ID is the first parameter, hence potionPoison.id. The second bit, although it looks complicated in that line, is merely how long it will last for. A higher integer means it will last longer. The final parameter is the amplifier to apply to it. In theory it should mean a stronger potion that deals the damage more quickly, but I haven't had a chance to tinker with it. Since I'm assuming your darts will act a lot like arrows, include that line of code in the same place you deal the damage to the entity you hit. Whether it's before or after shouldn't matter.
Thanks I put it in the code and I'm going to test now.
When the dart hits an enemy it should poison them.
How would I add the poisoning effect to them?
When creating a new potion effect to apply to an entity, the potion's ID is the first parameter, hence potionPoison.id. The second bit, although it looks complicated in that line, is merely how long it will last for. A higher integer means it will last longer. The final parameter is the amplifier to apply to it. In theory it should mean a stronger potion that deals the damage more quickly, but I haven't had a chance to tinker with it. Since I'm assuming your darts will act a lot like arrows, include that line of code in the same place you deal the damage to the entity you hit. Whether it's before or after shouldn't matter.
Thanks I put it in the code and I'm going to test now.