diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 230ef23b4..8f65f8e67 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1903,9 +1903,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ } $this->inventory->setItemInHand(Item::get(Item::AIR, 0, 1)); - $motion = $this->getDirectionVector()->multiply(10); + $motion = $this->getDirectionVector()->multiply(0.4); - $this->getLevel()->dropItem($this->add(0, 1, 0), $item, $motion); + $this->getLevel()->dropItem($this->add(0, 1.3, 0), $item, $motion); if($this->inAction === true){ $this->inAction = false; diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 8619f905c..2d00970d4 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -924,7 +924,7 @@ class Level implements ChunkManager, Metadatable{ * @param Vector3 $motion */ public function dropItem(Vector3 $source, Item $item, Vector3 $motion = null){ - $motion = $motion === null ? new Vector3(0, 0, 0) : $motion; + $motion = $motion === null ? new Vector3(lcg_value() * 0.2 - 0.1, 0.2, lcg_value() * 0.2 - 0.1) : $motion; if($item->getID() !== Item::AIR and $item->getCount() > 0){ $itemEntity = new DroppedItem($this->getChunkAt($source->getX() >> 4, $source->getZ() >> 4), new Compound("", [ "Pos" => new Enum("Pos", [ @@ -934,9 +934,9 @@ class Level implements ChunkManager, Metadatable{ ]), //TODO: add random motion with physics "Motion" => new Enum("Motion", [ - new Double("", $motion->x + (lcg_value() * 0.2 - 0.1)), - new Double("", $motion->y + 0.2), - new Double("", $motion->z + (lcg_value() * 0.2 - 0.1)) + new Double("", $motion->x), + new Double("", $motion->y), + new Double("", $motion->z) ]), "Rotation" => new Enum("Rotation", [ new Float("", lcg_value() * 360),