positioned method

Execute positioned(
  1. dynamic loc
)

Positioned sets the execution point of the command to a new Location, Heightmap or Entity.

Execute.positioned(
	Entity.player(), // Location...
	children: List<Widget> [
		Command('/say I get executed')
	]
),

⇒ execute positioned as @p run say I get executed

Implementation

Execute positioned(dynamic loc) {
  if (loc is Heightmap) return over(loc);

  if (!(loc is Location || loc is Entity)) {
    throw ('Please insert either a Location or an Entity into Execute.positioned');
  }
  return _addArgumentRet('positioned ${loc is Entity ? 'as ' : ''}$loc');
}