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?
#Invisible Model
20 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Paste version of tridents.js from @upbeat goblet
I have the trident texture in the item folder.
@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 => {})
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?
you dont need to specify the model json, you'd stick your model json in the kubejs>models>item>youritemname.json folder
Oh so I don't need the item.modeljson?
What would go in .item then?
I have the model in the appropriate folder.
im saying if you needed the item builder its there for you
i wasnt really suggesting you use it for anything in particular
Ah, I see.
Oh I'm just stupid-
I was using a geckolib model instead of an item model.
I just need to position it correctly now.
oh nice
This isnt a big issue, but how would I go about getting the trident to flip in hand when about to throw it?
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
Alrighty, thank you though.