Jump to content

Recommended Posts

Posted

It seems that whenever the item would be destroyed by damage it is only destroyed on the server and not the client. I should also mention that using player.inventoryContainer.refresh() or whatever it's called does nothing.

Here is the src file, note: look into the itemRightClick method.

Posted

There is no onItemRightClick in that class file. Just a bunch of crap in onCreated.

What are you trying to achieve?

 

Whoops, sorry about that. I am working on two completely different mods right now and it is confusing me a bit. As for what I am trying to do, whenever you craft the (MagicItem) it will look at the item that you are holding. If it is an instance of ItemGlove then damage it otherwise kill the player.

For some reason however, whenever the item is "destroyed" the client doesn't get the information and just resets the damage to 0.

Posted

First of all this and therefor this will never be true.

 

Then: This check will crash on a server. You cannot check the keyboard directly like that in common code.

 

I see what you mean for the Keyboard but that is something else completely. Just ignore that. And what do you mean when you say needsEssence will never be true? It is set to true if the object has a tag. And yes, the tag compound can be null.

Posted

Where do you "create the Object"?

 

I see what you were talking about, I updated the post above. Apparently you had text highlighted but github's highlighter is very light and hard to see on my monitor.

Posted

You know what onCreated does, right? It gets called when your Item gets crafted. At that point the NBTTagCompound will always be null, unless your crafting result already has NBT.

 

And that is exactly why it's there. Some of my crafting recipes already have a tag, hence it even being there.

Posted

Actually from looking at vanilla code, damageItem does not properly destroy stacks when they reach size 0, unless they are a Bow (don't ask me why that is). So you have to check for that manually.

 

Wow, that doesn't make any sense whatsoever. Do you think you could help me out on this then? If you look at the item code you will notice that I already have this set up but I am using VERY improperly. If you could give me a few pointers that would help a ton.

Posted

Ok, so now that I have that part fixed could you help me out as to why everything is doubled when I hold shift to get the recipe? It acts like it is run twice but the output is still the same.

Posted

ItemCraftedEvent is a FML Event. Are you registered to the FML EventBus?

 

Yeah, every other event in that class works fine. I have tried elevating that one to a higher priority and even making it static but nothing is fixing it. I have no idea what's going on here.

Is it wrong that I registered it like: MinecraftForge.EVENT_BUS.register(new EventManager());?

Posted

ItemCraftedEvent is a FML Event. Are you registered to the FML EventBus?

 

Yeah, every other event in that class works fine. I have tried elevating that one to a higher priority and even making it static but nothing is fixing it. I have no idea what's going on here.

Is it wrong that I registered it like: MinecraftForge.EVENT_BUS.register(new EventManager());?

 

Always... always.... register in the right event bus.

 

 

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.