TextComponent.entityNbt constructor

TextComponent.entityNbt(
  1. Entity entity, {
  2. required String path,
  3. bool? interpret,
  4. Color? color,
  5. bool? bold,
  6. bool? underlined,
  7. bool? italic,
  8. bool? strikethrough,
  9. bool? obfuscated,
  10. TextClickEvent? clickEvent,
  11. TextHoverEvent? hoverEvent,
  12. String? insertion,
})
TextComponent.entityNbt
Entity the entity which has nbt to display
path the path as a String
interpret bool if nbt should be interpreted as TextComponent(optional)
...same properties... from TextComponent
TextComponent.entityNbt(
	Entity.Selected(),
	path: 'CustomName'
	underlined: true
)
⇒ {'entity':'@s','nbt':'CustomName','underlined':true}

Implementation

TextComponent.entityNbt(
  Entity entity, {
  required String path,
  bool? interpret,
  this.color,
  this.bold,
  this.underlined,
  this.italic,
  this.strikethrough,
  this.obfuscated,
  this.clickEvent,
  this.hoverEvent,
  this.insertion,
}) {
  value = {'nbt': path, 'entity': entity.toString()};
  if (interpret != null) value['interpret'] = interpret;
}