Destroy all entities in a volume in 1.12

In Minecraft 1.12, I'm trying to destroy all mobs and items in a volume, but not players. So far, I have the following command, but in my test world, it won't necessarily kill all mobs, especially slimes spawned as a result of killing larger slimes:

/kill @e[x=1000,z=-2500,dx=10,dz=-10]

Can anyone advise?

Clarification: I mean that when I use the kill command to kill a slime, the resulting smaller slimes seem invulnerable to subsequent kill commands. I don't feel that should be the case. Also, I'd love to use coordinates relative to the command block if possible. And my command does not despawn loose items.

The context is that I'm trying to build a Tardis-like structure that uses commands and structure blocks. But when I replace the structure with a similar volume of air, the chests leave items behind and the mobs also stay behind. I'm hoping to save the structure (including mobs), delete entities (items and mobs), then replace with air to make the structure disappear cleanly.

UPDATE: I'm now using this command:

kill @e[type=!minecraft:player,x=1000,z=-2500,dx=10,dz=-10]

I realized I can't precede it with a slash for it to work in a command block. Don't know why it killed the first time and not subsequent times before, but now it kills every time, including slimes. It still doesn't destroy loose items, though. Any tips? Also, can I do coordinates relative to the command block?


Solution 1:

Smaller slimes spawn after the big ones die, so you have to kill them again afterwards. The same applies to items. The alternative would be to teleport them under y-level -64, that way they are instantly deleted.

Solution 2:

If you don't want the slimes to spawn ever again you should first disable mob spawning using /gamerule doMobSpawning false and then execute the kill command in a repeating command block for about 30 seconds (or infinitely if you prefer). Please do note that the gamerule command will disable the mob spawning for the whole world.

EDIT: I did not notice 'but not players.' The kill command would be

/kill @e[type=!minecraft:player,x=1000,z=-2500,dx=10,dz=-10]

Solution 3:

What I do if I don't want to kill me but do want to kill everything else is drink a potion of fire protection and then dig a hole filled with lava and a ladder leading out at the side. I then do a /tp @e ? ? ? and then climb up the ladder because I'm fireproof.