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

[1.16.x] Item Property Override in Tick Method


urbanxx001
 Share

Recommended Posts

During the tick method in an item's entity class, I'm altering the item's custom NBT tags. The tags are being updated, but the method tied to one of them that handles a property override, isn't. (no texture change is seen). The model files are correct, as the override works in a SpecialRecipe class. What could be the issue? Idk if it's related to this by chance (although that deals with capabilities). 

Edited by urbanxx001
Link to comment
Share on other sites

22 hours ago, diesieben07 said:

Look at ItemEntity for how it does it.

After looking at the ItemEntity class as you suggested, it seems to handle syncing with EntityDataManager. However, getShareTag and readShareTag also exist, as well as onEntityItemUpdate in the item class. Which of these would be the best option?

Edited by urbanxx001
Link to comment
Share on other sites

I appreciate all your help. I've created a data key in the entity class which is being updated, but I'm not sure how to link it with the tag in the item class (responsible for the property override). Either that or the key needs to be accessed from the item class too. Alternatively I've tried an if statement in the override method, to detect when an entity is created and tell it to grab a float from the entity class instead. This works, but it updates all modItemEntities in the world as it's not an instance of the current item.

 

ModItemEntity with Data Key https://pastebin.com/TeQMiEKf

Edited by urbanxx001
Link to comment
Share on other sites

Right you can store that in the key... sorry for the stupid questions. All set now.

Edit: Oml I just realized getItem and setItem are the built-in methods for itemstack data 🤦. I've used getItem before but it never occured to me that it was for a data key.

Edited by urbanxx001
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • What on earth... Did you put all those entries there? This file should usually be empty. Are you using any antivirus software? If so: Which? Do you have any Minecraft-related software installed (third party launchers)? If so: Which?
    • I can't dm, so i'll attach it here  # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # #      102.54.94.97     rhino.acme.com          # source server #       38.25.63.10     x.acme.com              # x client host # localhost name resolution is handled within DNS itself. #    127.0.0.1       localhost #    ::1             localhost 127.0.0.1    codeload.github.com 127.0.0.1    support.kaspersky.ru 127.0.0.1    kaspersky.ru 127.0.0.1    virusinfo.info 127.0.0.1    forum.kasperskyclub.ru 127.0.0.1    cyberforum.ru 127.0.0.1    soft-file.ru 127.0.0.1    www.360totalsecurity.com 127.0.0.1    cezurity.com 127.0.0.1    www.dropbox.com 127.0.0.1    193.228.54.23 127.0.0.1    spec-komp.com 127.0.0.1    eset.ua 127.0.0.1    panel.koronavirusfuck.xyz 127.0.0.1    360totalsecurity.com 127.0.0.1    www.esetnod32.ru 127.0.0.1    www.comss.ru 127.0.0.1    blog-pc.ru 127.0.0.1    www.securrity.ru 127.0.0.1    vellisa.ru 127.0.0.1    download-software.ru 127.0.0.1    drweb-cureit.ru 127.0.0.1    softpacket.ru 127.0.0.1    www.kaspersky.com 127.0.0.1    www.avast.ua 127.0.0.1    www.avast.ru 127.0.0.1    zillya.ua 127.0.0.1    safezone.ua 127.0.0.1    vms.drweb.ru 127.0.0.1    www.drweb.ua 127.0.0.1    free.drweb.ru 127.0.0.1    biblprog.org.ua 127.0.0.1    free-software.com.ua 127.0.0.1    free.dataprotection.com.ua 127.0.0.1    www.drweb.com 127.0.0.1    www.softportal.com 127.0.0.1    www.nashnet.ua 127.0.0.1    softlist.com.ua 127.0.0.1    it-doc.info 127.0.0.1    esetnod32.ru 127.0.0.1    blog-bridge.ru 127.0.0.1    remontka.pro 127.0.0.1    securos.org.ua 127.0.0.1    pc-helpp.com 127.0.0.1    softdroid.net 127.0.0.1    malwarebytes.com 127.0.0.1    ru.vessoft.com 127.0.0.1    AlpineFile.ru 127.0.0.1    malwarebytes-anti-malware.ru.uptodown.com 127.0.0.1    ProgramDownloadFree.com 127.0.0.1    download.cnet.com 127.0.0.1    soft.mydiv.net 127.0.0.1    spyware-ru.com 127.0.0.1    remontcompa.ru 127.0.0.1    www.hitmanpro.com 127.0.0.1    hitman-pro.ru.uptodown.com 127.0.0.1    www.bleepingcomputer.com 127.0.0.1    soft.oszone.net 127.0.0.1    krutor.org 127.0.0.1    RuTracker.org 127.0.0.1    www.greatis.com 127.0.0.1    unhackme.ru.uptodown.com 127.0.0.1    programy.com.ua 127.0.0.1    softobase.com 127.0.0.1    www.besplatnoprogrammy.ru 127.0.0.1    unhackme.en.softonic.com 127.0.0.1    unhackme.com 127.0.0.1    unhackme.ru 127.0.0.1    nnm-club.name 127.0.0.1    vgrom.com 127.0.0.1    moneropool.com 127.0.0.1    mine.moneropool.com 127.0.0.1    xmr.cryptopool.org 127.0.0.1    pool.monero.org 127.0.0.1    minexmr.com 127.0.0.1    monero.crypto-pool.fr 127.0.0.1    dwarfpool.com 127.0.0.1    disk-space.ru 127.0.0.1    file7.ru 127.0.0.1    ufille.ru 127.0.0.1    rgho.st 127.0.0.1    yadi.su 127.0.0.1    catcut.net 127.0.0.1    fsdisk.ru 127.0.0.1    rpfile.ru 127.0.0.1    cheats.file-a.ru 127.0.0.1    file-space.org 127.0.0.1    sfailo.ru 127.0.0.1    sendspace.com 127.0.0.1    www.sendspace.com 127.0.0.1    fille-7.ru 127.0.0.1    loufile.ru 127.0.0.1    file-seven.com 127.0.0.1    file-a.ru 127.0.0.1    fail-7.ru 127.0.0.1    1-kk.ru 127.0.0.1    rufile.net 127.0.0.1    filexpwx.space 127.0.0.1    sfile.net 127.0.0.1    mdiskfile.com 127.0.0.1    mega.nz 127.0.0.1    dfile.su 127.0.0.1    rgfail.ru 127.0.0.1    rudwnl.ru 127.0.0.1    dfile.info 127.0.0.1    flles.ru 127.0.0.1    pool.minexmr.to 127.0.0.1    ska4ay.pl 127.0.0.1    ska4ay.ru 127.0.0.1    ska4ay.club 127.0.0.1    ska4ay.net 127.0.0.1    ska4ay.org 127.0.0.1    ska4ay.com 127.0.0.1    ska4ay.pro 127.0.0.1    ska4ay.pw 127.0.0.1    ska4ay.online 127.0.0.1    skachaty.pl 127.0.0.1    skachaty.ru 127.0.0.1    skachaty.club 127.0.0.1    skachaty.net 127.0.0.1    skachaty.org 127.0.0.1    skachaty.com 127.0.0.1    skachaty.pro 127.0.0.1    skachaty.pw 127.0.0.1    skachaty.online 127.0.0.1    skachay.pl 127.0.0.1    skachay.ru 127.0.0.1    skachay.club 127.0.0.1    skachay.net 127.0.0.1    skachay.org 127.0.0.1    skachay.com 127.0.0.1    skachay.pro 127.0.0.1    skachay.pw 127.0.0.1    skachay.website 127.0.0.1    skachay.online 127.0.0.1    ska4aty.pl 127.0.0.1    ska4aty.ru 127.0.0.1    ska4aty.club 127.0.0.1    ska4aty.net 127.0.0.1    ska4aty.org 127.0.0.1    ska4aty.com 127.0.0.1    ska4aty.pro 127.0.0.1    ska4aty.pw 127.0.0.1    ska4aty.online 51.68.172.243 authserver.mojang.com 51.68.172.243 sessionserver.mojang.com 51.68.172.243 launchermeta.mojang.com    
    • You don't need to worry about this anymore, Forge has fixed this in the installer.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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