diff --git a/src/main/java/world/bentobox/bentobox/hooks/MythicMobsHook.java b/src/main/java/world/bentobox/bentobox/hooks/MythicMobsHook.java index 40273c9ac..0cff041d7 100644 --- a/src/main/java/world/bentobox/bentobox/hooks/MythicMobsHook.java +++ b/src/main/java/world/bentobox/bentobox/hooks/MythicMobsHook.java @@ -63,11 +63,9 @@ public boolean spawnMythicMob(MythicMobRecord mmr, Location spawnLocation) { /** * Spawn a MythicMob and run a callback once the entity has actually been spawned. *
- * Spawning is delayed by 40 ticks inside this hook (to give NMS-pasted blocks time
- * to settle), which means the caller cannot act on the spawned entity synchronously.
- * This overload accepts a {@link Consumer} that will be invoked with the live Bukkit
- * {@link Entity} once the mob has been spawned, so that addons (e.g. AOneBlock) can
- * perform follow-up work such as clearing space for large hitboxes.
+ * Delegates to {@link #spawnMythicMob(MythicMobRecord, Location, Consumer, long)}
+ * with a 40-tick delay — the historical behaviour, required by blueprint-paste
+ * callers so blocks settle before mobs land on them.
*
* @param mmr MythicMobRecord
* @param spawnLocation location
@@ -76,13 +74,32 @@ public boolean spawnMythicMob(MythicMobRecord mmr, Location spawnLocation) {
* @since 3.14.0
*/
public boolean spawnMythicMob(MythicMobRecord mmr, Location spawnLocation, Consumer
+ * Blueprint-paste callers need a short delay so NMS-pasted blocks settle
+ * before mobs land on them; synchronous callers (e.g. AOneBlock's
+ * {@code MythicMobCustomBlock}) can pass {@code 0} to spawn immediately on
+ * the current tick. When {@code delayTicks <= 0} the spawn runs inline and
+ * the {@code onSpawn} callback is invoked synchronously.
+ *
+ * @param mmr MythicMobRecord
+ * @param spawnLocation location
+ * @param onSpawn callback invoked with the spawned Bukkit entity; may be {@code null}
+ * @param delayTicks ticks to wait before spawning; {@code <= 0} = spawn immediately
+ * @return true if the mob type exists and a spawn was scheduled (or ran)
+ * @since 3.15.0
+ */
+ public boolean spawnMythicMob(MythicMobRecord mmr, Location spawnLocation,
+ Consumer