---
# System prepended metadata

title: kill
tags: [' MCEA', content, ' technology']

---

---
title: kill
tags: content, MCEA, technology
---


# /kill：殺死生物

```java
public static void register(CommandDispatcher<CommandSource> dispatcher) {
    dispatcher.register(Commands.literal("kill")
        .requires(
            (p_198521_0_) -> {        
                return p_198521_0_.hasPermissionLevel(2);
            }
        )
        .executes(
            (p_198520_0_) -> {
                return killEntities(p_198520_0_.getSource(), ImmutableList.of(p_198520_0_.getSource().assertIsEntity()));
            }
        )
        .then(Commands.argument("targets", EntityArgument.entities())
            .executes(
                (p_229810_0_) -> {
                     return killEntities(p_229810_0_.getSource(), EntityArgument.getEntities(p_229810_0_, "targets"));
                }
            )
        )
    );
}
```

p_198520_0_: source
p_229810_0_: target