# mceditlib.operations.entity — mceditlib 0.1 documentation

### Navigation

- index
- modules |
- mceditlib 0.1 documentation »
- Module code »
- mceditlib.operations »

# Source code for mceditlib.operations.entity

    """
        entity
    """
    from __future__ import absolute_import, division, print_function
    import logging
    from mceditlib.operations import Operation

    log = logging.getLogger(__name__)

    class RemoveEntitiesOperation(Operation):
        def __init__(self, dimension, selection):
            super(RemoveEntitiesOperation, self).__init__(dimension, selection)

        def operateOnChunk(self, chunk):
            """

            :type chunk: WorldEditorChunk
            """
            ents = []
            for ref in chunk.Entities:
                if ref.Position not in self.selection:
                    ents.append(ref)

            chunk.Entities[:] = ents
            chunk.dirty = True

### Navigation

- index
- modules |
- mceditlib 0.1 documentation »
- Module code »
- mceditlib.operations »