#Invisible Model

20 messages · Page 1 of 1 (latest)

upbeat goblet
#

I'm using EntityJS to try and make some custom tridents. So far the throwing works and shows up fine, but the held item is invisible. I also tried making an icon like the regular trident has, but that just shows up as a 2d item in hand. How would I go about getting the item to load the texture properly?

urban kayakBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

fading sentinelBOT
#

Paste version of tridents.js from @upbeat goblet

upbeat goblet
#

I have the trident texture in the item folder.

weary narwhal
#

@acoustic fox Sitti

acoustic fox
#

this is the same as any other item with kubejs, you need a model file for your item if you want it to render as one in your hand

#

for reference to bring up the item builder in from the entity builder you'll do js .item(item => {})

upbeat goblet
#
StartupEvents.registry("entity_type", event => {
    event.create("dive_aquamarine_trident", "minecraft:trident")
        .scaleModelForRender(context => {
            let { entity, poseStack } = context;
            let persistentData = entity.persistentData;
            if (!persistentData.yaw || !persistentData.pitch) {
                persistentData.yaw = 0;
                persistentData.pitch = 0;
            }
            if (entity.clientSideReturnTridentTickCount <= 0) {
                let velX = entity.getDeltaMovement().x();
                let velY = entity.getDeltaMovement().y();
                let velZ = entity.getDeltaMovement().z();
                let yaw = Math.atan2(velZ, velX) * (180 / JavaMath.PI) - 90;
                let pitch = Math.atan2(velY, Math.sqrt(velX * velX + velZ * velZ)) * (180 / JavaMath.PI);
                poseStack.mulPose(Axis.YP.rotationDegrees(-yaw));
                poseStack.mulPose(Axis.XP.rotationDegrees(-pitch));
                persistentData.yaw = yaw;
                persistentData.pitch = pitch;

            } else {
                let storedYaw = persistentData.yaw;
                let storedPitch = persistentData.pitch;
                poseStack.mulPose(Axis.YP.rotationDegrees(-storedYaw));
                poseStack.mulPose(Axis.XP.rotationDegrees(-storedPitch));
            }
        })
        .item(item => {
            item.modelJson({
                
          })
      })
})```
I'm assuming its supposed to be something along the lines of this then?
I'm unsure where to go from here though, would I need to define where the model and texture are located in the item.modelJson space?
acoustic fox
#

you dont need to specify the model json, you'd stick your model json in the kubejs>models>item>youritemname.json folder

upbeat goblet
#

Oh so I don't need the item.modeljson?
What would go in .item then?
I have the model in the appropriate folder.

acoustic fox
#

im saying if you needed the item builder its there for you

#

i wasnt really suggesting you use it for anything in particular

upbeat goblet
#

Ah, I see.

upbeat goblet
#

Oh I'm just stupid-
I was using a geckolib model instead of an item model.

#

I just need to position it correctly now.

acoustic fox
#

oh nice

upbeat goblet
#

This isnt a big issue, but how would I go about getting the trident to flip in hand when about to throw it?

acoustic fox
#

i think thats something to do with setting up custom model data like how the bow changes models when using

#

maybe someone else would know how to do that

upbeat goblet
#

Alrighty, thank you though.