# Vector3 vs Position

Comments in 'Plugin Development' started by Dinokiller, Jul 5, 2014.

1. Offline

### DinokillerNotable Member

Joined:
Sep 22, 2013
Posts:
376
Minecraft User:
Why have Vector3 if you have Position? This is a question I've been trying to figure the answer to ever since I started writing plugins for PocketMine-MP. I understand that Vector3 can be used for calculations and such but couldn't you just use Position for all of this?
2. Offline

### xpyctumActive MemberPlugin Developer

Joined:
Jan 13, 2014
Posts:
292
Plugins:
4
Minecraft User:
You can use two methods together! Why not?
3. Offline

### DinokillerNotable Member

Joined:
Sep 22, 2013
Posts:
376
Minecraft User:
You mean combine Position and Vector3 into one class? You're not using the correct terms so I can't understand what you mean.
4. Offline

### xpyctumActive MemberPlugin Developer

Joined:
Jan 13, 2014
Posts:
292
Plugins:
4
Minecraft User:
Yep.
5. Offline

### DinokillerNotable Member

Joined:
Sep 22, 2013
Posts:
376
Minecraft User:
Yeah that I was thinking, there's no point in 2 different objects.
6. Offline

### PEMapModderNotable MemberPlugin Developer

Joined:
Oct 9, 2013
Posts:
7,294
Plugins:
11
Minecraft User:
Because using Vector3 is more memory-efficient.
7. Offline

### iksakuNotable MemberPlugin Developer

Joined:
Sep 2, 2013
Posts:
1,130
Plugins:
4
Minecraft User:
Wrong... Position implements X, Y, Z and Level information, this is used when you need to specify coordinates in the specified world.
Vector3 implements X, Y and Z on "the actual world".
Check out the code, if you check "\$player->teleport(Vector3 \$pos, \$yaw = false, \$pitch = false)", you can see that need Vector3
Last edited: Jul 6, 2014
8. Offline

### PEMapModderNotable MemberPlugin Developer

Joined:
Oct 9, 2013
Posts:
7,294
Plugins:
11
Minecraft User:
Vector3 is used normally, but if you want to pass the level datum too, use Position. Basically, just use Vector3 unless you want the level datum too.
iksaku likes this.
9. Offline

### iksakuNotable MemberPlugin Developer

Joined:
Sep 2, 2013
Posts:
1,130
Plugins:
4
Minecraft User:
yup
10. Offline

### PEMapModderNotable MemberPlugin Developer

Joined:
Oct 9, 2013
Posts:
7,294
Plugins:
11
Minecraft User:
You can put position for that, if you want to change world too.