getPersistentData() stops compiling [solved]

Started by Silly Billy on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
getPersistentData() stops compiling [solved]
Sun, 12/08/2024 - 13:15 (edited)

[to solve this issue you clear all cache]

entity.getPersistentData().putDouble("redrep", (entity.getPersistentData().getDouble("redrep") - 1));
^
symbol: method getPersistentData()
location: variable entity of type Entity
3 errors
> Task :compileJava FAILED

This is one of the three errors my console showed me. What I did was create a procedure for when my custom mob dies (Im creating a faction reputation system and this is a guard for a faction) so when this mob dies it sets the event entities custom number nbt tag "redrep" (reputation of the red faction) to the current redrep subtracted by 1. however this block code is stopping my stuff from compiling somehow and I cant figure out what it is or how to fix it myself.

Edited by Silly Billy on Sun, 12/08/2024 - 13:15
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try clicking the plaster…
Tue, 10/22/2024 - 12:09

Try clicking the plaster icon in the top right

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
regenerate code and build?…
Tue, 10/22/2024 - 14:53

regenerate code and build? If so I have tried that multiple times and it doesnt seem to change anything about my issue so far.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you send your procedure?
Tue, 10/22/2024 - 14:55

Can you send your procedure?

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
package net.mcreator…
Wed, 10/23/2024 - 13:58
package net.mcreator.deepwokenxcliffworld.procedures;

/* imports omitted */

public class RedStickfigureGuardEntityDiesProcedure {
public static void execute(Entity entity) {
if (entity == null)
return;
entity.getPersistentData().putDouble("redrep", (entity.getPersistentData().getDouble("redrep") - 1));
}
}
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I cannot send a screenshot…
Wed, 10/23/2024 - 13:59

I cannot send a screenshot of the blocks unfortunately as I do not know how

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am using 1.20.1 fabric…
Fri, 11/01/2024 - 11:04

I am using 1.20.1 fabric generator for 2023.4

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok im going to just abandon…
Thu, 12/05/2024 - 13:05

ok im going to just abandon this because im so cooked no one can help me

Hmm, well this seems to be…
Tue, 12/10/2024 - 17:07

Hmm, well this seems to be fabric bug. In this case the logical next step would be to report the bug to the plugin author, and not to the general public on those forums here