Modifying or removing vanilla items is difficult, as you normally can't modify vanilla code. The way people usually do this is by using workarounds to replace the vanilla block with their own modded version, without the player noticing. You would make a modded version of the dragon egg, and then either change the loot table of the vanilla dragon egg so it drops your own, or find a way to replace the block when it generates, depending on how you need it to function. (This would also be pretty straight forward, since the dragon egg always falls at the same position.)
For simpler things, you could conceivably just run procedures involving the vanilla block; but in most cases where you want to seriously modify something, replacing it with your own version is a better course of action.
Modifying or removing vanilla items is difficult, as you normally can't modify vanilla code. The way people usually do this is by using workarounds to replace the vanilla block with their own modded version, without the player noticing. You would make a modded version of the dragon egg, and then either change the loot table of the vanilla dragon egg so it drops your own, or find a way to replace the block when it generates, depending on how you need it to function. (This would also be pretty straight forward, since the dragon egg always falls at the same position.)
For simpler things, you could conceivably just run procedures involving the vanilla block; but in most cases where you want to seriously modify something, replacing it with your own version is a better course of action.