generate method
Implementation
@override
Widget generate(Context context) {
if (_type == 'clear') {
return CommandBuilder('effect clear $entity').string(
effect?.name,
prefix: 'minecraft:',
);
} else {
return CommandBuilder('effect give $entity')
.string(
effect!.name,
prefix: 'minecraft:',
)
.when(
duration == null || duration!.isInfinite,
then: 'infinite',
otherwise: duration?.seconds.toStringAsFixed(0),
)
.string('$amplifier ${!showParticles!}');
}
}