Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by urbanxx001

  1. For some reason I was under the impression it would only work there, but you're right it works under the mod space. I did some more testing and it seems it's a problem with the modifier itself after changing something last minute. I'll mark the thread as finished for now. Thanks for the advice though. Edit: I'm an idiot the modifier works I completely forgot I added a condition where certain items were required to make the tools function. I'm losing it lol
  2. As the title says, everything runs perfectly in dev, but after building the mod and running it, my global loot modifiers don't work. No errors show in the log so I'm not sure what the issue is. I'm certain it's not my custom loot conditions (registered under the minecraft namespace), since I use vanilla conditions as well and those don't work. My global_loot_modifier is located in data/forge/loot_modifiers/(file): And the modifiers are in data/mod_id/loot_modifiers/(file): Any help is appreciated.
  3. Ah ok that makes sense, I should've looked closer at the list of loot conditions. Thanks!
  4. I have a loot modifier that updates all loot tables to drop specific items when using certain tools. Or at least I thought it did. It works on blocks, but not for entities. However I've tested it with the condition "killed_by_player" and that works for entities, the problem is testing these conditions together fails: So then I tried creating a custom ILootCondition, which registered fine but still failed: If anyone has advice I'd be very appreciative.
  5. As the title says, I was wondering what the updated method/process for addScheduledTask is. I need this for an event similar to: @SubscribeEvent public void onEntityJoin(final EntityJoinWorldEvent event) { Minecraft.getInstance() //(not recognized)--> .addScheduledTask(new Runnable() { @Override public void run() { } }); } For the FML setup event I've used: event.enqueueWork(() -> { } But I'm not sure what's required for a simple event. The context for this is collecting what language the client is using and then sending a packet to sync with the server. But the packet must be delayed or it fails in this event. Edit: Actually I can do the same thing when the player loads a container needing it. So the event's probably unnecessary
  6. Edit: I figured it out, thanks to Poopoodice's answer in another thread saying that online mode in server properties must be set to false. This was required because I received an invalid session error after attempting to join the server.
  7. Of course this is your thread and we're here to help you. If the place you're trying to access the items is a part of the inventory object (the block, tile entity, container, etc. classes) then it's easier. But if you're still in the process of creating your inventory, I'd suggest any of the following: -Forge docs on Tile Entities -Minecraft By Example topics. -Examine the source code for objects like Chests. Outside of block/TE/container, an easy way is the player's containerMenu value that I mentioned before, which is whatever menu is currently open: Container container = player.containerMenu
  8. Sorry, yes Luis is right it's just a helper function for resourcelocation: public static ResourceLocation getLocation(String name) { return new ResourceLocation(MOD_ID, name); } As he and diesieben said though, if it's a simple problem like calling openGui and registering the screen, then packets are unnecessary, but you need to describe it in more detail.
  9. The inputs are just a template- in this case it's two strings, but they can be ints, chars, etc. or none at all, depending if you need to initially send info across sides. I'd suggest reading Forge's documentation on packets first if you haven't used them before: Forge Docs Networking You usually send the packet by invoking handler methods: ModPacketHandler.sendToServer(new C2SPacketForContainer(input1, input2)); Where the handler class has packet registration and the methods: The register methods are called in common setup.
  10. Yeah the VillagerUtil was used in conjunction with the POI Forge registry, but you're right it's superfluous and I should stick with the simpler way. Thank you Ash
  11. To begin where are you trying to access info for the container? From the server or client? If it's the latter you'll need to send a C2S packet. Then the easiest way to collect info is when the player opens the inventory, since they have a containerMenu variable. The packet would look something like:
  12. Ah ok glad you found a solution. For the Start sub class of LivingEntityUseItemEvent, cancelling it or setting duration <= 0 should prevent it as well.
  13. I'm not sure how the change in platform is causing the error, but your best bet would be to create a fresh environment on your Mac and then copy all the class files over if you haven't already
  14. So I'm nearly finished with a version of my mod and, although I haven't done mapping changes in awhile, I'm confident that I have the correct MCP name so that an instance of reflection runs properly. However, the new method name isn't recognized during load in the real environment (I'm aware it needs to be changed back to run in dev). I cross-referenced both the output.srg as well as a Discord bot and they tell me that: func_221052_a in PointOfInterestType.class should be registerBlockStates Attached is the relevant class and log file. Any help is appreciated. Loading Output Log Villager Util class:
  15. Here's the class for attempt 1. For attempt 2 I've also tried assigning random UUID's and/or random modifier names for each item instance, but they still remain linked.
  16. Hi MadAlchemist, if you open the AbstractZombieModel class, you can see that the following controls the arms-out zombie pose: public void setupAnim(T p_225597_1_, float p_225597_2_, float p_225597_3_, float p_225597_4_, float p_225597_5_, float p_225597_6_) { super.setupAnim(p_225597_1_, p_225597_2_, p_225597_3_, p_225597_4_, p_225597_5_, p_225597_6_); ModelHelper.animateZombieArms(this.leftArm, this.rightArm, this.isAggressive(p_225597_1_), this.attackTime, p_225597_4_); } public abstract boolean isAggressive(T p_212850_1_); So the easiest way to apply this to a player model is copy the AbstractZombieModel class, but have it extend PlayerModel rather than BipedModel. You may need to add another animateZombieArms line that takes in this.leftSleeve and this.rightSleeve from PlayerModel. Finally you'll want your entity renderer to copy the AbstractZombieRenderer class (and add a CapeLayer from PlayerRenderer to your constructor if certain players have capes). Then player skins should fit your custom zombie.
  17. 1) For this your best bet is to create a LivingAttackEvent and/or LivingDamageEvent to check the damage received, and also check if the player is wearing your armor. Both events have values for source and amount that can help you determine what to do from a "lethal" attack. 2) What you describe would most easily be enacted as a repair item for your armor, like how the phantom membrane restores elytra. Then each time the durability (or a special durability) is repaired by anvil or crafting, you can increment an NBT value to count how many times it's been repaired. 3) I would take a look at the BipedArmorLayer class for how vanilla armor is rendered. You can then specify that model in the item class with: @Nullable @Override public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) { return (A) new MyArmorModel(); } and then the texture with something such as: @Nullable @Override public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { if(!"overlay".equals(type)) return "mod_id:textures/models/armor/my_armor.png"; else { return "mod_id:textures/models/armor/my_armor_overlay.png"; } } Hope this helps
  18. From this post, I've modified the original armor attribute of my custom item. The biggest change between that post and now is that the attribute multimap is immutable, so it needs to be copied to a mutable map, adjusted, and then copied to an immutable one again. Normally it would be easier to create a new armor material, however the value I need depends on a variable (extraArmor) in the item class. The armor value changes correctly, but only when one instance of the item is present in the inventory. If another one is there, then the armor of the newest instance overwrites the previous item(s). I've tired alternatives such as adding a new armor modifier (Attempt 2) or using an ItemAttributeModifierEvent instead of getAttributeModifiers, but they all face the same problem. I'm not sure why they would change since the extraArmor value isn't static and isn't called or updated statically as far as I'm aware. If anyone can help I'd be grateful. Attempt 1: Edit original values Attempt 2: Add unique modifier
  19. I'm sending a packet with a character as input, but when handling it it's interpreted as a Chinese character. Is there special decoding to convert it correctly, and if so how? Thanks Edit: Nevermind my write method was the issue.
  20. Adding that did the trick! Thank you so much
  21. Ah ok, thanks. Iterating over spawners vs entity types makes more sense. I've modified the event to mirror mincount, maxcount etc. as well: Although the entity is still refusing to spawn lol. I've debugged the event to see if the custom mob is being added to the spawns, and it is. I've tried registering the spawns outright vs adding on biome load, but it doesn't make a difference. I think the problem lies somewhere in the actual entity class that's preventing it, I'll take a thorough look tomorrow. I appreciate your help.
  22. These are SRG names, which are semi-obfuscated. In your PizzaItem constructor you can rename p_i48487_1_ to "properties" or whatever you wish. Any input parameters like this can be renamed, it's only when you're referencing actual variable or method names from the source that you can't rename them.
  23. I'm only quoting so that you receive a notification, because normally replies don't notify for some reason. Anyway Your best bet to create an aura would be a render overlay like how the player is on fire, and activate it from a RenderLivingEvent: @Mod.EventBusSubscriber(modid = Main.MOD_ID) public class ForgeSubscribeEvents { @SubscribeEvent public void onRenderEntity(RenderLivingEvent.Post event) { //code here } } In the event you'll handle pushing and popping the render matrix stack, which is what the post on greyminecraftcoder is talking about, despite being a bit outdated. I've tried tackling it here in 1.16.X but with little success. It might be easier to go the particle route if you still want to do that though. This would be handled by a LivingUpdateEvent which you've probably already done: @SubscribeEvent public static void onLivingUpdate(final LivingEvent.LivingUpdateEvent event) { //code here } However bending which way the particles face as per the link so that they're concentric to the player would still likely involve the matrix stack.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.