-
Posts
1830 -
Joined
-
Last visited
-
Days Won
12
Everything posted by DavidM
-
AFAIK there is no proper way of doing so. One wild idea would be to create a custom implementation of LightTexture, and override LightTexture#updateLightmap to take your custom potion effect into account. Then use reflection to change the lightmapTexture field in GameRenderer (from the field gameRenderer in the Minecraft instance from Minecraft#getMinecraft) to an instance of your own LightTexture. However I am sure this will break many things and might not work as intended. Personally, I would just use the normal night vision effect.
-
Checking if a player swung with full attack power
DavidM replied to Javisel's topic in Modder Support
Try subscribing to AttackEntityEvent. AttackEntityEvent fires before the cool down reset. Overriding IForgeItem#onLeftClickEntity should also work. -
Checking if a player swung with full attack power
DavidM replied to Javisel's topic in Modder Support
My bad. Just checked and realized LivingDamageEvent is triggered after calculations, but before the damage applies. It is probably triggered after the ticksSinceLastSwing is reset to 0. -
Checking if a player swung with full attack power
DavidM replied to Javisel's topic in Modder Support
LivingDamageEvent is triggered before the attack deals damage. LivingDamageEvent#getSource returns the damage source, which, if is an instance of EntityDamageSource (when an entity inflicts the damage), will record the entity that dealt the damage, and can be obtained with EntityDamageSource#getTrueSource. If the return entity is an instance of EntityPlayer, you can get the attack cool down with EntityPlayer#getCooldownPeriod or EntityPlayer#getCooledAttackStrength. -
Depending on how you want to implement such behavior, there are multiple ways of doing so. One example can be found here (not so well written in my opinion but is the best I could find) : https://github.com/Ellpeck/ActuallyAdditions/blob/master/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java.
-
...wut? Nononononono. 1. Try with a VPN. 2. Get a better (faster) internet connection.
-
Is such fields only used in client-side render calculation?
-
An Entity contains properties such as posX, posY, rotationYaw, rotationPitch, etc. However, such fields also have "prev" counterparts like prevPosX and prevRotationYaw. What is the purpose of such "prev" fields?
-
Please be more specific. What packet? Vanilla or modded? On the client side or server side?
-
Check out the code for AbstractHorseEntity. When in doubt, always read the source code. Don't rely on tutorials.
-
How to stop forge from sending mod in server handshake modlist
DavidM replied to Tastac's topic in Modder Support
Doing so is highly discouraged, as this provides cheating potential. -
I am creating a way to render multiblock structures in the world. I am planning to write a custom multiblock container, but I am not sure whether there is already a multiblock storage, in which case I shouldn't reinvent the wheel. Is there already a way of storing multiblock structures?
-
The I'm afraid your modpack won't launch. Try removing mods until the crash no longer occurs, then add mods back in one-by-one until you find the culprit(s).
-
FORGE Open With Java And Command Prompt
DavidM replied to PauloGamer2009's topic in Support & Bug Reports
Please only make one thread per problem. Please elaborate. I have no idea what you are talking about. -
/kill @e [{some params here that specifies squid that I can't recall; look up on the Minecraft wiki}]
-
Checking if a player swung with full attack power
DavidM replied to Javisel's topic in Modder Support
@Animefan8888 You're back! @Javisel Post your code. That method gives the percentage of the attack cool down. -
Checking if a player swung with full attack power
DavidM replied to Javisel's topic in Modder Support
EntityPlayer#getCooledAttackStrength. -
Diferentiating items on the Player's Inventory [SOLVED]
DavidM replied to Doctor Moonbad's topic in Modder Support
Please note that items and blocks are singleton. Your method of adding timer won't work as the same timer will be used on all players and all instances of ItemStack with your Item. -
[1.14.4] Registering a custom Stairs Block leads to a crash
DavidM replied to F43nd1r's topic in Modder Support
Do not use static initializers. Initialize your items and blocks during the appropriate registry events. Please post a GitHub repo of your mod. -
That is not going to change anything. Particles must be spawned on the client. If an event on the server is supposed to create particles, the server must send packet(s) to notify the client(s).
-
Since the CHANCES field is public, is it recommendable to just replicate what ComposterBlock::registerCompostable does and add the entry into the CHANCES field manually?
-
Multiple face blocks showing up as black and purple
DavidM replied to uraniumcrystalsmaster's topic in Modder Support
From the file name of your classes, I can already tell that you are following bad tutorials. Most YouTube tutorials on modding are rather bad as they promote bad coding practices and outdated methods. Please read the common issues and recommendations pinned at the top of this forum to learn how to fix those bad practices. I would suggest to rewrite/refractor your code after that. As for your problem, I don't see that you've added a texture for your block. -
Wut? OptiFine is not compatible with Forge in 1.14.
-
Please keep this forum in English. The installer log is generated in the same directory as the installer.