Allows you to replace any 1.3 effect with any other effect, including custom ones. Also allows you to set a custom effect to spawn when a block is destroyed, instead of the default one.
local effectReplacer = require("effectReplacer")
-- Replace the Goomba death effect (ID 4) with a custom effect (ID 751)
effectReplacer.registerID(4, 751)
-- Setting the replacement effect ID to 0 will result in the original effect simply being removed
effectReplacer.registerID(4, 0)
-- Alternatively, you can also provide a function that runs whenever the effect is replaced
effectReplacer.registerID(4, 751, function(oldEffect, newEffect)
newEffect.speedY = oldEffect.speedY
end)
local effectReplacer = require("effectReplacer")
-- Replace the destroy effect of the SMW cement block (ID 115) with effect ID 751
effectReplacer.registerBlockDestroyEffect(115, 751)
-- Setting the destroy effect ID to 0 will result in no effects spawning from the block
effectReplacer.registerBlockDestroyEffect(115, 0)
-- Alternatively, you can also provide a function that runs whenever the block is destroyed
effectReplacer.registerBlockDestroyEffect(115, 751, function(block, effect)
effect.speedY = block.speedY
end)
Although I'm not sure if I'm using it correctly or if there's something wrong with this because when I try to replace block 4's breaking effect, it still spawns the basegame effect