Context pad unique for each icon

Hello,
I have a little problem:
If I write the CustomContextPadProvider it works fine.

import inherits from 'inherits';

import ContextPadProvider from 'bpmn-js/lib/features/context-pad/ContextPadProvider';

import {
  isAny,
  is
} from 'bpmn-js/lib/features/modeling/util/ModelingUtil';

import {
  assign,
  bind
} from 'min-dash';


export default function CustomContextPadProvider(injector, connect, translate) {
  injector.invoke(ContextPadProvider, this);
  var cached = bind(this.getContextPadEntries, this);

  const _getContextPadEntries =
    ContextPadProvider.prototype.getContextPadEntries;
    ContextPadProvider.prototype.getContextPadEntries = function(element) {
   
      const entries = _getContextPadEntries.apply(this, [element]);
      delete entries["append.end-event"];
      delete entries["append.intermediate-event"];
      delete entries["append.gateway"];
      delete entries["append.append-task"];
      delete entries["append.text-annotation"];
      delete entries["replace"];
      return entries;
    }

}

inherits(CustomContextPadProvider, ContextPadProvider);

CustomContextPadProvider.$inject = [

  'injector',

  'connect',

  'translate'
];

But I want a different context pad for bpmn:Task for example only an end Event. But if I add if(is(element, ‘bpmn:Task’)){} it doesn’t work anymore.

Any suggestions?

What means “it doesn’t work anymore”? What doesn’t work in particular?