Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Magic. All that is important to you as the mod developer is that methods marked with certain annotations are called automatically for you. SubscribeEvent and EventHandler are of that type. You only need to tell Forge about the class in some manner (in this case, that's handled by another annotation: @Mod.EventBusSubscriber).
  2. This does nothing useful. You're saying "this dragon is now sheared" and the function goes "Ok!" and the state of the dragon (whether or not it has been sheared) doesn't change. There's a reason it's called a setter. It sets a field.
  3. Function overhead is almost zero.
  4. I can't help you fix code that hasn't been written. Write it, then show it to me along with what it isn't doing. And use a debugger to see what's going wrong.
  5. PlayerEvent.ItemPickupEvent will handle anything dropped into the world. AnvilRepairEvent will handle anything with the anvil. PlayerContainerEvent.Open will handle chests. PlayerEvent.ItemCraftedEvent handles crafting. However. Since we're dealing with 1.12 and the fact that you should be using Capabilities... You should be using the AttachCapabilitiesEvent<ItemStack> event to attach a capability to the stack when it is created.
  6. I don't know why you're doing this in PlayerTick anyway. But that aside... 1) Do you have more than one sword in your inventory? 2) Are you calling this function from anywhere else?
  7. Well you have to actually update the things that need updating. protected boolean isArrow(ItemStack stack) { return stack.getItem() instanceof ItemArrow; } You're still consuming arrows in order to consume ammo. ItemArrow itemarrow = (ItemArrow)((ItemArrow)(itemstack.getItem() instanceof ItemArrow ? itemstack.getItem() : Items.ARROW)); EntityArrow entityarrow = itemarrow.createArrow(worldIn, itemstack, entityplayer); And still using arrows to get the entity to spawn.
  8. @SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { if (!event.player.getEntityWorld().isRemote) { if (event.phase == Phase.START) { System.out.println(event.player.world.getTotalWorldTime()); } } } I am not able to replicate. 42997 42998 42999 43000 43001 43002 If it was running twice per tick, I would see doubled output.
  9. Are you checking Server vs. Client as well? I don't know because you haven't posted any code
  10. PlayerTickEvent is one of the events that has a phase, START and END.
  11. Well...is your current code posted somewhere?
  12. Math. Time Left In Ticks = Duration - (Current Time - Start Time) Time Left in Minutes = Time Left in Ticks / (20 * 60)
  13. "It hurts doctor. It hurts." Please define "doesn't work" in a manner that is actually troubleshootable.
  14. "It hurts doctor. It hurts." Please define "doesn't work" in a manner that is actually troubleshootable.
  15. It is fired for everything.
  16. Well. You're still asking the vanilla arrow item for the entity that it spawns...
  17. The tooltip gets updated every render frame. You can query the current time from the world (getInformation is Side-Only so you can safely use Minecraft.getMinecraft() if necessary) and calculate the duration.
  18. The block doesn't control texture and model. The json files and the registry name do.
  19. If you want a projectile to not look like an arrow, you'd need to create a new entity class. The last time I did that was 1.7: https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/entity/EntitySpecialArrow.java
  20. Technically there are 4 different names: The original source (only Mojang has this) The obfuscated names, aka Notch names (these are generated by the compile process and look like aa.bbcfa, you would see these if you opened the vanilla jar in JD-GUI, these will be arbitrary as source code changes) The SRG names (these are the ones you're seeing, generated by the decompile process with names like p_12345_c and func_765432_f and are generally stable as the source code changes and new versions are released) The MCP names (these are community supplied via MCPbot, mapped to SRG names)
  21. Current version is 1.12, previous version is 1.11. 1.7.10 threads have been locked and closed as unsupported for at least 6 months. Heck, there's one still on the first page.
  22. 1.7.10 is no longer supported here
  23. Have you considered posting this in Support and Bug Reports?
  24. You can download it from GitHub https://github.com/MinecraftForge/Documentation

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.