#Swinging a weapon using the Item Wizard causes it to simply move in a circle, not tilt forwards.

68 messages · Page 1 of 1 (latest)

lofty stoneBOT
#
Welcome to the help forum!

Please make sure to read #1029468016594911232 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

oak kite
#

that's just how it is for attachables, even the vanilla trident have this same problem

rose terrace
#

animation.player.first_person.attack_rotation is the animation the player entity has for punching.

You can copy it and customize it to fit attachables, though it's a little annoying to make

#

yes, you just need to use q.is_item_name_any(slot.weapon.mainhand) or q.get_equipped_item_name to filter one or the other animation, in the first person animation controller.
https://bedrock.dev/docs/stable/Molang#query.is_item_name_any
https://bedrock.dev/docs/stable/Molang#query.get_equipped_item_name

In Vanilla, the attack animation is only weighted by v.attack_time > 0.0f.

If you implement your own attack animation for attachables next to it, you can use for it: v.attack_time > 0.0f && q.any(q.get_equipped_item_name, 'custom_item_1', 'custom_item_2').

And conversely, for the original vanilla animation: v.attack_time > 0.0f && !q.any(q.get_equipped_item_name, 'custom_item_1', 'custom_item_2'), the exclamation point inverts the condition

#

yes, but there's quite a bit more to implement to easily mirror the animation in first person.

I've written the steps to make that for another person a while ago, it may be a bit confusing to follow since we were conversing about their model, but I think it's all there https://discord.com/channels/314078526104141834/1175877179079405658

#

Or, actually, I think I got confused, only some of the process is similar. That other person was asking about showing the player's arms in first person and animating them

#

Ok I reread the post, and the start of it is about putting the item in the left hand.

#

To make that, you can start with just making the item in the right hand, and then deal with mirroring it.

You'll have to apply a custom "empty hand" animation on the left arm bones to position the attachables correctly. Then, just duplicate the right side of the model and flip it (bind it to leftitem too), and that should do it

#

Once correctly setup, you'll be able to just copy and paste the model, or keyframes in your animations, and use Flip X

#

If you're lost at any point, feel free to ask again how to do specific things. It's a little easier for me if you send files or screenshots of them to show where you are at.

rose terrace
rose terrace
#

@foggy flax You can use any query in the keyframes of an animation. They won't do anything in Blockbench, but in game they will return the values corresponding to the entity that plays these animations. In Blockbench, you can use the Variable placeholders tab to give them values, to preview the result, but you won't need them for what you want to do (except for the custom first person animation, but you have other things to implement before doing that)

#

Careful with the cubes that aren't bound to a group. Blockbench will create another group for you, but it's best to nest everything you want it to manually.

#

You should start by implementing your attachable with just the "hold" animations.

You did setup correctly in Blockbench by picking the 1st person Animation mode. All you need to do is adjust the item's rotation and position to match what you want

#

I recommend you use a group named "root" at the root of the model, then another one named "item" or something similar. "item" should contain the cubes of your model, and have the binding to rightitem

#

This is because there can be a position offset between the game and Blockbench, although that bug may have been fixed. Nothing to worry about if you have a root group.

#

https://wiki.bedrock.dev/items/attachables.html#top this guide can help you. It's slightly outdated in some parts last time I checked, but if something isn't right you can look into it. Use the Method n°2 in it.

#

!faq content-log

lofty stoneBOT
# rose terrace !faq content-log
FAQ
Bedrock: Content Log

Content Log in Minecraft Bedrock Edition helps you identify issues in resource and behavior packs. You can enable it here:
Press Ctrl + H to bring up the GUI once enabled

rose terrace
#

toggling this one will also help tackling issues due to misspelling / bad syntax

#

nest item under root now

#

I also recommend positioning the weapon near the origin in the bind pose (what it looks like in Edit Mode, without any animation applied), in such a way that makes it easy to pose in third person (basically minor adjustments like shifting the position of the weapon to the side by 0.5 or 1 unit).
Make sure both the root and item groups have a pivot point at [0,0,0]

#

no, you'd want it wherever the handle is. Wherever the weapon is handled from, to make animations easily

#

Do keep the pivot points at [0,0,0], it's the cubes inside that you should move to put the middle of the handle also at [0,0,0] in Global space

#

I'll be going now, I can check again later today.

https://wiki.bedrock.dev/items/attachables.html#method-2-bound-to-a-bone regarding this tutorial, diregard the Display Settings part, you don't need this now that there are 1st and 3rd person preview in Blockbench. The paragraphs above about bindings are still relevant, but I think you probably got that part already.

rose terrace
#

The scale tool is the one meant to scale up or down the model uniformly, or only on chosen axis. If you select the root group and scale, it should work well. Though for bedrock entity models, you’ll want to avoid decimals for the size of cubes, it makes the texture resolution inconsistent and weird to work with.

If you need to adjust the size of the weapon, you should probably do it by hand with the resize tool and position tool, the scale tool is more useful when you make meshes in the generic format, or when you have big complex models you need to resize.
You can also use scale keyframes in the "hold" animations on the item group to tweak the scale by just a bit

rose terrace
#

I mean yeah, to do it cleanly.

You haven't textured it yet by the looks of it, so there is not much to lose. If you want to respect the texture resolution and style of Minecraft, you'll have to come up with simpler models. Things like a trigger mechanism could be simplified to just 1 or two pixels on a plane, or even not be there at all. If you're not after that, then it's ok to keep the model big, and just scale it down in the "hold" animations.

Whatever you do, don't size things in between 0 and 1, it will be a pain to texture. Keeping every cuboid size a multiple of 1 is best too.

rose terrace
#

You have stretched UVs pretty much everywhere, you're probably using the Per-face UV mode, but have resized cubes after you created the texture.

You should delete the current one, and create a new texture using the template (keep the options about regenerating the UVs).
Alternatively, you can do it manually, by selecting the UVs and using the Auto UV tool.

rose terrace
#

Just tried the leggings preset, and it gave me the same errors, I'm not sure where something went wrong with the plugin preset.

Here's a modified geo file for you to work off of, I made sure it worked in game:

rose terrace
#

What I sent is a model. You should find the attachable file, and edit to reference "geometry.cat_tail" in its geometry. Or the other way around, rename the identifier of the geometry I sent.

rose terrace
#

can you open the model I sent with its texture in Blockbench, and see that it's just like Vanilla iron leggings?

#

You should download the texture I sent with it, and implement it just to have a clean base

#

As for the error, I think you may have one too many bracket at the end of the attachable. Are you using Visual Studio Code to edit your files?

#

oh yeah nevermind about that bracket, it looks good

#

Can you wear the "Steve" Skin for your player, and take another screenshot in game, floating mid-air?

Whatever you have makes it difficult to understand where the armor is

#

Are you using some third party addon to change your player skin?

#

Alright

#

Double check the identifiers in the attachable file and on the model. The texture as well, make sure it's the iron leggings one. It still looks like it's using another model and/or texture

#

Make sure to not keep duplicates of models in the same project with the same identifier, or whatever entity that uses them will pick one of the two at random, and you'll be left wondering what went wrong if you forgot about them

#

And still the same thing in game? All while making sure you're wearing the right item

#

Triple check the texture path. Is the texture reference the one that I sent you and that you can see in Blockbench.
The one over the torso in game looks like an old one from a texture template

#

Use your PC's file explorer?

You can right click the texture in Blockbench and do "Show in File Explorer" to go faster

#

that's only the geo file, and not even the directory of where it saved to

#

ok, what about the texture? Are you using Windows?

#

Do you know what the file explorer is

#

And find the iron leggings texture for the model, in the textures folder

#

you have implemented "pink_cat_tail", not "cat_tail"

#

in the attachable

#

Is it pink and black in game?

#

or is it something else

#

Well, check again the texture path, for the attachable and on your PC

#

And does it look good in Blockbench when you apply that texture to that model?

#

Yw

oak kite
#

remove durability count from the code

#

and also durability use

#

yes

#

also remove the event that decreases durability amount

oak kite
#

in events, usually below components

oak kite
#

that I have no current ideas for fixing that problem

rose terrace
#

send your animation file if you can. If not send a screenshot. It must be missing a bracket, or has an extra one. Something of that ilk

rose terrace
#

I don't know

#

The file you sent is valid. But the error points to another file: slime_staff.animation.json. Look for issues there. Maybe this file does not contain any animation

rose terrace
#

The error about the item is pretty self-explanatory, open the file in Visual Code and check where a curly bracket is missing.

#

As for the binding expression errors, I think they come from the leggings model you have going, but it is different from the one I uploaded.

In the one I uploaded, I just named the groups the same as the ones on the Vanilla player geometry (root, body, rightleg, leftleg), which is an alternative way of making attachable groups follow the wearer's geometry. They don't need binding expressions then.

You have renamed 'body' to 'body2', so that one won't follow the Vanilla 'body' group.
You must have binding expressions on each group since you get errors about that, and I believe it is because you used the names of some armor model, instead of the player model's groups.

There isn't any 'rightlegging' or 'belt' group on the player itself, you have ot reference 'rightleg', 'body' etc

rose terrace
#

Well I'm not in your PC, so check again?