Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows adding bones #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

anjoismysign
Copy link

Example:

// Context
World world; // some world
Location location; // some location
Spider spider; // some spider

// Create an ItemDisplay (spider.itemBones) or BlockDisplay (spider.blockBones)
ItemDisplay display = world.createEntity(location, ItemDisplay.class);
display.setTeleportDuration(1);
display.setTransformation(new Transformation(
        new Vector3f(0, 0.5f, 0.5f), //x > 0 is left, y > 0 is up, z > 0 is front
        new AxisAngle4f(0, 0, 0, 0), // if you would like to rotate to the left
        new Vector3f(1.25f, 1.25f, 1.25f), // the size
        new AxisAngle4f(0, 0, 0, 0))); // if you would like to rotate to the right
ItemStack skull = new ItemStack(Material.WITHER_SKELETON_SKULL);
display.setItemStack(skull);
display.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.FIXED);

// Let the spider "connect the dots"
spider.getItemBones().add(head);

Example in-game:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant