Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Confusion abounds regarding zombie conversion methods

Open Machine-Maker opened this issue 3 years ago • 0 comments

Is your feature request related to a problem?

There are several methods related to "conversion" on the Zombie interface. We have getConversionTime, setConversionTime, isConverting, isDrowning, startDrowning (deprecated), and stopDrowning.

It is important to note at this point, Zombie has several subinterfaces, Husk, Drowned, ZombieVillager, and PigZombie.

For all 5 of these mob types, the underwater conversion logic works if you call the deprecated startDrowning method. After the specified time, they turn into the converted mob. However, only 3 of them show the shaking animation (this is a client side thing, zombified piglins and zombie villagers don't shake for drowned conversion).

The problem comes when you try to use the suggested replacement for startDrowning, setConversionTime. It is documented as starting the drowning process BUT for zombified piglins it throws a UOE and for zombie villagers it does something completely different, start the conversion process to a villager.

Something needs to be done to clear all this confusion up, as well as offer non-deprecated methods to allow control over the different conversion processes.

A secondary, but related thing, is that there might be valid API uses for just setting the converting entity data which causes a shaking animation on 3/5 (4/5 if you include zombie villagers other conversion type). Right now that's only done via the conversion timers.

Describe the solution you'd like.

I think a solution would be to deprecate the get/setConversionTime and isConverting methods. 1 of the subinterfaces of Zombie has 2 conversion processes and so these methods do not make sense as they are not specific as to which process they control. Separate methods for controlling the drowned conversion process should exist (we already have some that are kind of duplicates). Then methods should be added to just the ZombieVillager interface to control the villager conversion process.

Describe alternatives you've considered.

n/a

Other

No response

Machine-Maker avatar Nov 01 '22 07:11 Machine-Maker