Skip to content

Mob fails to teleport with plugin when Item Display is riding it #10024

@Pitrex111

Description

@Pitrex111

Expected behavior

Entity being succesfully teleported as by tp command.

Observed/Actual behavior

Teleport fails when Item Display entity rides teleported entity.

Steps/models to reproduce

In my case, I create Slime mob like that:
hitbox_ = loc.getWorld().spawn(loc, Slime.class, slime -> { slime.setSize(3); slime.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(5); slime.addPotionEffect(PotionEffectType.HEAL.createEffect(1, 20)); // slime.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, PotionEffect.INFINITE_DURATION, 0, false, false)); slime.setSilent(true); slime.setAI(false); slime.setLootTable(LootTables.EMPTY.getLootTable()); slime.setGravity(false); slime.setRemoveWhenFarAway(false); slime.customName(Component.text("Flying Present")); MobLibrary.markMob(slime, MobType.FlyingPresent); });
Then I teleport it with : hitbox_.teleport(dest); to simulate movement.
When slime is alone teleport works fine, when I'll add Item Interaction entity for custom model like that:
present_ = hitbox_.getWorld().spawn(hitbox_.getLocation(), ItemDisplay.class, display -> { MobLibrary.markMob(display, MobType.TempEntity); display.setItemDisplayTransform(ItemDisplayTransform.HEAD); ItemStack model = new ItemStack(Material.POISONOUS_POTATO); ItemMeta meta = model.getItemMeta(); meta.setCustomModelData(4); model.setItemMeta(meta); display.setItemStack(model); display.setTransformation(new Transformation(new Vector3f(0, -0.5f, 0), new AxisAngle4f(), new Vector3f(2f, 2f, 2f), new AxisAngle4f())); }); hitbox_.addPassenger(present_);
Then somehow teleport fails to work, but when I switch teleport to this Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tp " + hitbox_.getUniqueId() + " " + dest.getX() + " " + dest.getY() + " " + dest.getZ()); then it again works just fine.
Output effects to be seen in this video clip: https://youtu.be/_kHVRLJerEk

Plugin and Datapack List

[10:20:28 INFO]: Server Plugins (17):
[10:20:28 INFO]: Bukkit Plugins:
[10:20:28 INFO]: - ArmorStandEditor, ICraft2.0-Special, *JoinFullServer, LogBlock, Multiverse-Core, Multiverse-Inventories, Multiverse-Portals, NoChatReports, *PermissionsEx, PexTabCompleter
[10:20:28 INFO]: ProtocolLib, *SimplePrefix-Reloaded, TreasureChestX, *VoidWorld, VotifierPlus, WorldEdit, WorldGuard

[10:20:43 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[10:20:43 INFO]: There are no more data packs available

Paper version

10:21:46 INFO]: Checking version, please wait...
[10:21:46 INFO]: This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7)
You are running the latest version
Previous version: git-Paper-132 (MC: 1.20.1)

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Invalid

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions