Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Using Minecraft#player to get Player NBT Data Not Working
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 2
teh_black_d00m

Using Minecraft#player to get Player NBT Data Not Working

By teh_black_d00m, January 20 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

teh_black_d00m    0

teh_black_d00m

teh_black_d00m    0

  • Tree Puncher
  • teh_black_d00m
  • Members
  • 0
  • 9 posts
Posted January 20 (edited)

I have used a Capability to store a lot of data on to the player and usually Im able to access the data just fine and get the correct values by using  the capability's interface  (called IStats) . here is an example of using the Capability to get the necessary values that works fine
 

Spoiler

if(attacker instanceof EntityPlayer)
		{
			EntityPlayer player = (EntityPlayer) attacker;
			IStats playerStats = player.getCapability(StatsProvider.STATS_CAPABILITY, null);		
			ItemStack weaponstack = player.getHeldItemMainhand();
			Item weapon = weaponstack.getItem();
			
			
		    if(weapon instanceof ItemMyWeapons)
		    {
		    	float rawDamage = damage;
		    	int maxCondition = weaponstack.getMaxDamage();
				int condition = weaponstack.getMaxDamage() - weaponstack.getItemDamage();
			 	
		    	System.out.print("\nWeapon's damage is  " + rawDamage);
		    	
			 	
		    	rawDamage *= 0.5 + 0.01 * playerStats.getStat(StatConstants.STRENGTH);
    			rawDamage *= (float)condition / (float)maxCondition;
    			
    			return round1(rawDamage, 2);
		    }
			return 0;
		}
		else if (attacker instanceof EntityMob)
		{
		  float rawDamage = damage;
		  IMobStats mobStats = attacker.getCapability(MobStatsProvider.MOB_STATS_CAPABILITY, null);
		  
		  rawDamage *= 0.5 + 0.01 * mobStats.getStat(StatConstants.STRENGTH);
		  
		  return round1(rawDamage, 2);
		}
		return 0;

 

But when I try to do this
 

Minecraft.getMinecraft().displayGuiScreen(new CharacterSheetGUI(Minecraft.getMinecraft().player));

once the GUI is displayed its giving me incorrect numbers. Here is the GUI code if it helps

Spoiler

public class CharacterSheetGUI extends GuiScreen{
	
	ResourceLocation texture = new ResourceLocation(Reference.MOD_ID, "textures/gui/vanillabook.png");
	int guiHeight = 192;
	int guiWidth = 192;
	GuiButton button1;
	GuiButton button2;
	GuiButton button3;
	EntityPlayer player;
	int  page = 0;
	
	final int BUTTON1 = 0;
	final int BUTTON2 = 1;
	final int BUTTON3 = 2;
	
	public CharacterSheetGUI(EntityPlayer player)
	{
		this.player = player;
	}
	
	Minecraft mc = Minecraft.getMinecraft();
	
	@Override
	public void drawScreen(int mouseX, int mouseY, float partialTicks)
    {
        drawDefaultBackground();
		Minecraft.getMinecraft().renderEngine.bindTexture(texture);
		int centerX =(width / 2) - guiWidth / 2;
		int centerY = (height /2) - guiHeight / 2;
        drawTexturedModalRect(centerX, centerY-20, 0, 0, guiWidth, guiHeight);
		
		
		IStats playerStats = player.getCapability(StatsProvider.STATS_CAPABILITY, null);
		ISkills playerSkills = player.getCapability(SkillsProvider.SKILLS_CAPABILITY, null);
		if(page == 0) {
			fontRenderer.drawString("Attributes ", centerX+40, centerY-5, 0x000000);
			fontRenderer.drawString("Strength: " + playerStats.getStat(StatConstants.STRENGTH), centerX+40, centerY+10, 0x000000);
			fontRenderer.drawString("Endurance: " + playerStats.getStat(StatConstants.ENDURANCE), centerX+40, centerY+20, 0x000000);
			fontRenderer.drawString("Speed: " + playerStats.getStat(StatConstants.SPEED), centerX+40, centerY+30, 0x000000);
			fontRenderer.drawString("Agility: " + playerStats.getStat(StatConstants.AGILITY), centerX+40, centerY+40, 0x000000);
			fontRenderer.drawString("Intelligence: " + playerStats.getStat(StatConstants.INTELLIGENCE), centerX+40, centerY+50, 0x000000);
			fontRenderer.drawString("Luck: " + playerStats.getStat(StatConstants.LUCK), centerX+40, centerY+60, 0x000000);
		
			fontRenderer.drawString("Major Skills", centerX+40, centerY+75, 0x000000);
			fontRenderer.drawString("Long Blade " + playerSkills.getStat(StatConstants.LONG_BLADE), centerX+40, centerY+90, 0x000000);
			fontRenderer.drawString("Short Blade " + playerSkills.getStat(StatConstants.SHORT_BLADE), centerX+40, centerY+100, 0x000000);
			fontRenderer.drawString("Axe " + playerSkills.getStat(StatConstants.AXE), centerX+40, centerY+110, 0x000000);
			fontRenderer.drawString("Spear " + playerSkills.getStat(StatConstants.SPEAR), centerX+40, centerY+120, 0x000000);
			fontRenderer.drawString("Heavy Armor " + playerSkills.getStat(StatConstants.HEAVY_ARMOR), centerX+40, centerY+130, 0x000000);
		}
		
		if(page == 1) {
			
			fontRenderer.drawString("Minor Skills ", centerX+40, centerY-5, 0x000000);
			fontRenderer.drawString("Strength: " + playerStats.getStat(StatConstants.STRENGTH), centerX+40, centerY+10, 0x000000);
			fontRenderer.drawString("Endurance: " + playerStats.getStat(StatConstants.ENDURANCE), centerX+40, centerY+20, 0x000000);
			fontRenderer.drawString("Speed: " + playerStats.getStat(StatConstants.SPEED), centerX+40, centerY+30, 0x000000);
			fontRenderer.drawString("Agility: " + playerStats.getStat(StatConstants.AGILITY), centerX+40, centerY+40, 0x000000);
			fontRenderer.drawString("Intelligence: " + playerStats.getStat(StatConstants.INTELLIGENCE), centerX+40, centerY+50, 0x000000);
			
			fontRenderer.drawString("Miscelleaneous Skills", centerX+40, centerY+75, 0x000000);
			fontRenderer.drawString("Long Blade " + playerSkills.getStat(StatConstants.LONG_BLADE), centerX+40, centerY+90, 0x000000);
			fontRenderer.drawString("Short Blade " + playerSkills.getStat(StatConstants.SHORT_BLADE), centerX+40, centerY+100, 0x000000);
			fontRenderer.drawString("Axe " + playerSkills.getStat(StatConstants.AXE), centerX+40, centerY+110, 0x000000);
			fontRenderer.drawString("Spear " + playerSkills.getStat(StatConstants.SPEAR), centerX+40, centerY+120, 0x000000);
			fontRenderer.drawString("Heavy Armor " + playerSkills.getStat(StatConstants.HEAVY_ARMOR), centerX+40, centerY+130, 0x000000);
		}
		
		super.drawScreen(mouseX, mouseY, partialTicks);
    }
	
	@Override
	public void initGui()
	{
		buttonList.clear();
		int centerX =(width / 2) - guiWidth / 2;
		int centerY = (height /2) - guiHeight / 2;
		buttonList.add(button1 = new GuiButton(BUTTON1, centerX+40, centerY +170, 100, 20, "Done"));
		buttonList.add(button2 = new GuiButton(BUTTON2, 0, 0, 50, 20, "Next")); 
		buttonList.add(button3 = new GuiButton(BUTTON3, 0, 30, 50, 20, "Previous"));
		button3.enabled = false;
		super.initGui();
	}
	
	public void updateButtons()
	{
		if(page == 1) {
			button2.enabled = false;
			button3.enabled = true;
		}
		if(page == 0) {
			button3.enabled = false;
			button2.enabled = true;
		}
		
		
			
	}
	
	@Override 
	protected void actionPerformed(GuiButton button) throws IOException
	{
		switch (button.id)
		{
			case BUTTON1: Minecraft.getMinecraft().displayGuiScreen(null);
				break;
			case BUTTON2: if(page == 0) page++;	
				break;
			case BUTTON3:  if(page == 1) page--;
				break;
		}	
		updateButtons();
		super.actionPerformed(button);
	}
	
	@Override
	public boolean doesGuiPauseGame()
    {
        return true;
    }
	

 


For example this line
 

fontRenderer.drawString("Long Blade " + playerSkills.getStat(StatConstants.LONG_BLADE), centerX+40, centerY+90, 0x000000);

will display Long Blade 0 (which is the value it is initialized to in the default implementation of IStats) instead of the actual value that's supposed to be there. How can I make make sure I am getting the correct data from the player? The mod is only meant to be single player if that changes anything

Edited January 20 by teh_black_d00m
  • Quote

Share this post


Link to post
Share on other sites

De Joker    0

De Joker

De Joker    0

  • Tree Puncher
  • De Joker
  • Members
  • 0
  • 7 posts
Posted January 20
46 minutes ago, teh_black_d00m said:

 


fontRenderer.drawString("Long Blade " + playerSkills.getStat(StatConstants.LONG_BLADE), centerX+40, centerY+90, 0x000000);

 

Where are you setting those StatConstants.LONG_BLADE?   maybe you are calling the drawString before the actual setting.

  • Quote

Share this post


Link to post
Share on other sites

Cadiboo    277

Cadiboo

Cadiboo    277

  • Reality Controller
  • Cadiboo
  • Members
  • 277
  • 3303 posts
Posted January 20

Are you syncing the values to the client? By default capability data is not synchronised between the server and client. 

  • Quote

Share this post


Link to post
Share on other sites

teh_black_d00m    0

teh_black_d00m

teh_black_d00m    0

  • Tree Puncher
  • teh_black_d00m
  • Members
  • 0
  • 9 posts
Posted January 20 (edited)
2 hours ago, Cadiboo said:

Are you syncing the values to the client? By default capability data is not synchronised between the server and client. 

Probably not because I don't know how to do that haha. For each field in the default implementation of IStats I've done this

public class FatigueStorage implements IStorage<IStats>
{
	
	@Override
	public NBTBase writeNBT(Capability<IStats> capability, IStats instance, EnumFacing side)
	{
		final NBTTagCompound tag = new NBTTagCompound();
		
		tag.setFloat("fatigue", instance.getFatigue());
		
		return tag;
	}
	

	@Override
	public void readNBT(Capability<IStats> capability, IStats instance, EnumFacing side, NBTBase nbt)
	{
		
		final NBTTagCompound tag = (NBTTagCompound) nbt;

		instance.setFatigue(tag.getFloat("fatigue")); 
		
	}
	
	
}

Is that not enough? Does the data still need to be synced even if the mod is only multiplayer?

 

EDIT: I mean the EXACT OPPOSITE. its singleplayer only

Edited January 20 by teh_black_d00m
typo
  • Quote

Share this post


Link to post
Share on other sites

teh_black_d00m    0

teh_black_d00m

teh_black_d00m    0

  • Tree Puncher
  • teh_black_d00m
  • Members
  • 0
  • 9 posts
Posted January 20
2 hours ago, De Joker said:

Where are you setting those StatConstants.LONG_BLADE?   maybe you are calling the drawString before the actual setting.

Those are all static final variables that are set in the StatConstants class. They are just used as indexes for the arrays holding the actual data

  • Quote

Share this post


Link to post
Share on other sites

Cadiboo    277

Cadiboo

Cadiboo    277

  • Reality Controller
  • Cadiboo
  • Members
  • 277
  • 3303 posts
Posted January 20

You need to make a packet to sync your capability data, I would give an example, but all my implementations are horrible, a quick forum search should yield some good results. The basics of it are

- have a (logical sever side) packet that implements IMessage and IMessageHandler

- register that packet for the logical server in your network manager

- send the packet when you need to sync data

An example of a network manager can be found here, and it is instantiated here

  • Quote

Share this post


Link to post
Share on other sites

teh_black_d00m    0

teh_black_d00m

teh_black_d00m    0

  • Tree Puncher
  • teh_black_d00m
  • Members
  • 0
  • 9 posts
Posted January 20

Okay I watched this tutorial

Spoiler

 

and i think I i mostly understand how to send packets but I'm still not really sure when I'm supposed to send one. I also dont know why when I try to display my custom NBT data using a Gui its not synced. Here is a class that draws some bars displaying the player's health and fatigue(capability I made)
 

Spoiler

public class GUIHandler {
	

	@SubscribeEvent
	public void onRenderHealthBar(Pre event)
	{
		if (event.getType().equals(RenderGameOverlayEvent.ElementType.HEALTH))
		{
			event.setCanceled(true); // Cancels the rendering of the HEALTH bar. Take a look at all the different ElementType's  
		}
		
		if (event.getType().equals(RenderGameOverlayEvent.ElementType.ARMOR))
		{
			event.setCanceled(true);   
		}
			
	}
	
	private final ResourceLocation bar = new ResourceLocation(Reference.MOD_ID, "textures/gui/hpbar.png");
	private final ResourceLocation fatigueBar = new ResourceLocation(Reference.MOD_ID, "textures/gui/fatiguebar.png");
	private final int textureWidth = 102;
	private final int textureHeight = 8;
	private final int barWidth = 100;
	private final int barHeight = 6;
	
	@SubscribeEvent
    public void onRenderGui(RenderGameOverlayEvent.Post event)
    {
		if (event.getType() != ElementType.EXPERIENCE) return;
		
		Minecraft mc = Minecraft.getMinecraft();
		
		//render health bar
		mc.renderEngine.bindTexture(bar);
		float healthRatio = mc.player.getHealth() / mc.player.getMaxHealth(); 
		int currentWidth = (int)(barWidth * healthRatio);
		
		int maxHealthInt = (int) mc.player.getMaxHealth();
		int currentHealthInt = (int) mc.player.getHealth();
		
		String maxHealth = String.valueOf(maxHealthInt);
		String currentHealth  = String.valueOf(currentHealthInt);
		
		//int posX = event.getResolution().getScaledWidth() / 2 +10;
		//int posY = event.getResolution().getScaledHeight() - 48;
		
		mc.ingameGUI.drawTexturedModalRect(5, 220, 0, 0, textureWidth, textureHeight);
		mc.ingameGUI.drawTexturedModalRect(6, 220, 1, textureHeight, currentWidth, textureHeight);
		
		
		//render fatigue bar
		IStats fatigueValue = mc.player.getCapability(StatsProvider.STATS_CAPABILITY, null);
		mc.renderEngine.bindTexture(fatigueBar);
		float fatigueRatio = fatigueValue.getFatigue() / fatigueValue.getMaxFatigue();
		int currentWidthF = (int)(barWidth * fatigueRatio);
		
		int maxFatigueInt = (int) fatigueValue.getMaxFatigue();
		int currentFatigueInt = (int) fatigueValue.getFatigue();
		
		String maxFatigue = String.valueOf(maxFatigueInt);
		String currentFatigue = String.valueOf(currentFatigueInt);
		
		mc.ingameGUI.drawTexturedModalRect(5, 235, 0, 0, textureWidth, textureHeight);
		mc.ingameGUI.drawTexturedModalRect(6, 235, 1, textureHeight, currentWidthF, textureHeight);
		mc.ingameGUI.drawString(mc.fontRenderer, currentFatigue + "/" + maxFatigue, 45, 235, Integer.parseInt("FFAA00", 16));
		mc.ingameGUI.drawString(mc.fontRenderer, currentHealth + "/" + maxHealth, 45, 220, Integer.parseInt("FFAA00", 16));
		
		
    }
}

 

Here is code that restores the player's fatigue

Spoiler

/*
		//Handles the return rate of fatigue every tick
		EntityPlayer player = (EntityPlayer) event.getEntity();
		
		if(player.getCapability(StatsProvider.STATS_CAPABILITY, null).getFatigue() <  player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue())
		{
			float fFatigueReturnBase = 0.25F;
			float fFatigueReturnMult = 0.02F;
			float x = fFatigueReturnBase + fFatigueReturnMult * player.getCapability(StatsProvider.STATS_CAPABILITY, null).getStat(StatConstants.ENDURANCE);
			
			if (x + player.getCapability(StatsProvider.STATS_CAPABILITY, null).getFatigue() > player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue())
				player.getCapability(StatsProvider.STATS_CAPABILITY, null).setFatigue(player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue());
			else
				player.getCapability(StatsProvider.STATS_CAPABILITY, null).fill(x);
		}
		*/

 

I put that code in a packet and I know that its working like its supposed to (restoring the fatigue) but for some reason the fatigue bar is not being draw correctly to show that its working. It actually was working before when I wasn't using a packet. Any idea why this is happening?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6692

diesieben07

diesieben07    6692

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6692
  • 45732 posts
Posted January 20
  • Stop thinking about "NBT data". NBT is a serialization format. You are storing data in a capability.
  • For capability data that is always needed on the client (like in your case for the HUD [not GUI!]), you need to send the packet in the following cases:
    • PlayerLoggedInEvent
    • PlayerRespawnEvent
    • PlayerChangedDimensionEvent
    • Whenever the data changes.
  • 6 minutes ago, teh_black_d00m said:

    I put that code in a packet and I know that its working like its supposed to (restoring the fatigue) but for some reason the fatigue bar is not being draw correctly to show that its working.

    I have no idea what you mean by "putting that code in a packet". You can't put "code in a packet".

  • Quote

Share this post


Link to post
Share on other sites

teh_black_d00m    0

teh_black_d00m

teh_black_d00m    0

  • Tree Puncher
  • teh_black_d00m
  • Members
  • 0
  • 9 posts
Posted January 20
6 minutes ago, diesieben07 said:

I have no idea what you mean by "putting that code in a packet". You can't put "code in a packet".

I mean to say that I moved that code I posted earlier so that its here now
 

Spoiler

public class MessageRestoreFatigue extends MessageBase<MessageRestoreFatigue>{

	@Override
	public void fromBytes(ByteBuf buf) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void toBytes(ByteBuf buf) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void handleClientSide(MessageRestoreFatigue message, EntityPlayer player) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void handleServerSide(MessageRestoreFatigue message, EntityPlayer player) {
		// do whatever you need to do
		if(player.getCapability(StatsProvider.STATS_CAPABILITY, null).getFatigue() <  player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue())
		{
			float fFatigueReturnBase = 0.25F;
			float fFatigueReturnMult = 0.02F;
			float x = fFatigueReturnBase + fFatigueReturnMult * player.getCapability(StatsProvider.STATS_CAPABILITY, null).getStat(StatConstants.ENDURANCE);
			
			if (x + player.getCapability(StatsProvider.STATS_CAPABILITY, null).getFatigue() > player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue())
				player.getCapability(StatsProvider.STATS_CAPABILITY, null).setFatigue(player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue());
			else
				player.getCapability(StatsProvider.STATS_CAPABILITY, null).fill(x);
			
			System.out.println("Fatigue is being restored");
		}
	}
	
}

 

And then I did this
 

Spoiler

@SubscribeEvent
	public void updateFatigue(LivingUpdateEvent event)
	{
		if(!(event.getEntity() instanceof EntityPlayer)) return;
		/*
		//Handles the return rate of fatigue every tick
		EntityPlayer player = (EntityPlayer) event.getEntity();
		
		if(player.getCapability(StatsProvider.STATS_CAPABILITY, null).getFatigue() <  player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue())
		{
			float fFatigueReturnBase = 0.25F;
			float fFatigueReturnMult = 0.02F;
			float x = fFatigueReturnBase + fFatigueReturnMult * player.getCapability(StatsProvider.STATS_CAPABILITY, null).getStat(StatConstants.ENDURANCE);
			
			if (x + player.getCapability(StatsProvider.STATS_CAPABILITY, null).getFatigue() > player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue())
				player.getCapability(StatsProvider.STATS_CAPABILITY, null).setFatigue(player.getCapability(StatsProvider.STATS_CAPABILITY, null).getMaxFatigue());
			else
				player.getCapability(StatsProvider.STATS_CAPABILITY, null).fill(x);
		}
		*/
		NetworkHandler.sendToServer(new MessageRestoreFatigue());
	}
	

 

I know it worked because it kept printing "Fatigue is being restored".

 

 

11 minutes ago, diesieben07 said:

For capability data that is always needed on the client (like in your case for the HUD [not GUI!]), you need to send the packet in the following cases:

  • PlayerLoggedInEvent
  • PlayerRespawnEvent
  • PlayerChangedDimensionEvent
  • Whenever the data changes. 

 

So am I correct in assuming that I need to send a packet in the above example (because I am changing the amount of fatigue the player has)? And if I send the packets correctly in the cases you mentioned my HUD will display the correct data right?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6692

diesieben07

diesieben07    6692

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6692
  • 45732 posts
Posted January 20
19 minutes ago, teh_black_d00m said:

I mean to say that I moved that code I posted earlier so that its here now

Why did you do this?

 

20 minutes ago, teh_black_d00m said:

(LivingUpdateEvent event)

Why are you using LivingUpdateEvent for players? PlayerTickEvent exists.

 

20 minutes ago, teh_black_d00m said:

So am I correct in assuming that I need to send a packet in the above example (because I am changing the amount of fatigue the player has)? And if I send the packets correctly in the cases you mentioned my HUD will display the correct data right?

Yes.

  • Quote

Share this post


Link to post
Share on other sites

teh_black_d00m    0

teh_black_d00m

teh_black_d00m    0

  • Tree Puncher
  • teh_black_d00m
  • Members
  • 0
  • 9 posts
Posted January 20
12 minutes ago, diesieben07 said:

Why did you do this?

I did that because I thought that's what you're supposed to do to send a packet (put the code into a class that implements IMessage and IMessageHandler) but maybe I'm still not quite understanding packets correctly. So for the example of restoring the player's fatigue I need to use that MessageRestoreFatigue class to send a packet right? I'm not sure of the correctly terminology here but I think I'm supposed to be sending data between the client and server so they are synced. Should I be using the toBytes and fromBytes methods to just send the data instead of doing what I did in the example (moving all the code into MessageRestoreFatigue)?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2097

Draco18s

Draco18s    2097

  • Reality Controller
  • Draco18s
  • Members
  • 2097
  • 14036 posts
Posted January 20 (edited)

"Packets" are a conversion between runtime data and a binary serialization format. That's all.

 

Look at this example:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/networking/ToClientMessageOreParticles.java

 

The only "code" that is there is writing to, and reading from, a ByteBuffer. Your MessageRestoreFatigue does fuckall: it writes no data and it reads no data and instead...gets the capability on the client and directly modifies the values there. What you should be doing, is sending a packet from the server to the client containing the fatigue value.

 

Your packet also does that on the networking thread, which is a major no-no.

Edited January 20 by Draco18s
  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Draco18s
      JSON questions

      By Draco18s · Posted 3 minutes ago

      LootTableLoadEvent. So you don't overwrite other mods' additional seeds. Change the number of "rolls"
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 27 minutes ago

      package net.batonfack.fantasymod.client.renders; import net.batonfack.fantasymod.FantasyMod; import net.batonfack.fantasymod.client.models.ModelUnicornWithAbstracHorse; import net.batonfack.fantasymod.client.models.ModelUnicornWitoutAbstracHorse; import net.batonfack.fantasymod.entities.UnicornEntity; import net.minecraft.client.renderer.entity.AbstractHorseRenderer; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.entity.passive.horse.AbstractHorseEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.IRenderFactory; @OnlyIn(Dist.CLIENT) public class UnicornEntityRender extends AbstractHorseRenderer<UnicornEntity, ModelUnicornWithAbstracHorse<AbstractHorseEntity>> // <<---The Line with the error { //public UnicornEntityRender(EntityRendererManager manager) { // super(manager, new UnicornEntityModel(0), 0f); //} //private static ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel; public static final ResourceLocation unicorn = new ResourceLocation("fantasymod:" + "textures/entity/unicorn_entity.png"); private static float shadowOpaque = 0.0f; public UnicornEntityRender(EntityRendererManager manager, ModelUnicornWithAbstracHorse<AbstractHorseEntity> UnicornModel, float p_i50961_3_) { super(manager, new ModelUnicornWithAbstracHorse<>(0.0f), p_i50961_3_); } @Override protected ResourceLocation getEntityTexture(UnicornEntity entity) { return unicorn; } public static class RenderFactory implements IRenderFactory<UnicornEntity> { @Override public EntityRenderer<? super UnicornEntity> createRenderFor(EntityRendererManager manager) { return new UnicornEntityRender(manager, new ModelUnicornWithAbstracHorse<>(0.0f), shadowOpaque); } } }  
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 28 minutes ago

    • The_Unkown675
      Can't connect to own server; No syncable config

      By The_Unkown675 · Posted 39 minutes ago

      Server debug file - https://paste.gg/p/anonymous/0671148362b5476fbce55b8922262dad Latest log file -https://paste.gg/p/anonymous/bab7c2b3ca0947df9b10bce9c2632c22 Hope this helps! If you need anything else please let me know, I'll be happy to help, thank you for your help!
    • diesieben07
      Forge 1.12.2 crashes and wont load world!

      By diesieben07 · Posted 40 minutes ago

      In the future please always post the debug.log. From the excerpt you posted it looks like your world got corrupted. Restore from backup.
  • Topics

    • plugsmustard
      1
      JSON questions

      By plugsmustard
      Started 2 hours ago

    • DragonITA
      46
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA
      Started Monday at 10:06 AM

    • The_Unkown675
      2
      Can't connect to own server; No syncable config

      By The_Unkown675
      Started 18 hours ago

    • PolarBr0
      1
      Forge 1.12.2 crashes and wont load world!

      By PolarBr0
      Started 59 minutes ago

    • Rick57
      1
      Clean forge installer

      By Rick57
      Started 3 hours ago

  • Who's Online (See full list)

    • Label
    • AdieCraft
    • Draco18s
    • MoeBoy76
    • nojomo123
    • plugsmustard
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Using Minecraft#player to get Player NBT Data Not Working
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community