copyWith method
Creates a new Entity based on the existing one and applies new arguments. (same as constructors)
Example:
Entity ent1 = Entity(type:Entities.sheep)
Entity ent2 = ent1.copyWith(distance:Range.to(1))
Implementation
Entity copyWith({
int? limit,
List<dynamic>? tags,
Team? team,
List<Score>? scores,
Map<String, dynamic>? nbt,
String? strNbt,
EntityType? type,
Area? area,
Range? distance,
Range? level,
Gamemode? gamemode,
String? name,
Rotation? isRotated,
Range? horizontalRotation,
Range? verticalRotation,
String? predicate,
}) {
var temp = Entity.clone(this);
temp._setArguments(
limit,
tags,
team,
scores,
nbt,
strNbt,
type,
area,
distance,
level,
gamemode,
name,
isRotated,
horizontalRotation,
verticalRotation,
predicate,
false,
);
return temp;
}