Jump to content

Recommended Posts

Posted

I want to use the Salmon as my base creature and add a new fish called "paranoia". I'm having a hard time finding the salmon texture to alter it. Also can i use Mod Maker as well when I finish creating the new files for the new fish? Thanks in advance 

Posted
3 hours ago, Micah Holmes said:

I want to use the Salmon as my base creature and add a new fish called "paranoia". I'm having a hard time finding the salmon texture to alter it. Also can i use Mod Maker as well when I finish creating the new files for the new fish? Thanks in advance 

Generally you can find all textures in "\assets\survival\textures". In case of the salmon it's called "salmon-pink.png" and can be found in "\assets\survival\textures\entity". If you can't find a texture, it probably means that a block doesn't use their own textures and reuses already existing ones. In that case you can open up the entities or shape .json-files and find out what textures are being used.

The wiki has a fairly good introduction to modding. I'd recommend to take a look.

Posted

Lots of progress made on making a new fish but I ran into a issue I hope some one can point out my mistake. 

 

image.thumb.png.cdd142ed3612017f20753b42c8dcb9c2.png

 

Making a new fish called "piranha". I used the Salmon shape and most of its code to make a new fish. I can see the new "item" in the creatures but it has not texture or icon. 

 

I'm hoping my code is correct:

{
	code: "piranha",
	class: "EntityFish",
	hitboxSize: { x: 0.5, y: 0.25 },
	eyeHeight: 0.2,
	drops: [],
	habitat: "Underwater",
	client: {
		renderer: "Shape",
		size: 0.7,
		shape: { base: "entity/water/piranha" },
		texture: { base: "entity/fish/piranha-red" },
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 0 }, 
			{ code: "interpolateposition" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable" },
			{ code: "despawn", minPlayerDistance: 8, belowLightLevel: 8, minSeconds: 300 },
		],
		animations: [
			{
				code: "hurt",
				animation: "hurt", 
				animationSpeed: 1,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "swim",
				animation: "swim"
			},
			{
				code: "swimfast",
				animation: "swim"
			},
			{
				code: "die",
				animation: "dead",
			},
			{
				code: "flop",
				animation: "flopping"
			},
			{ 
				code: "idle", 
				animation: "idle",
				blendMode: "AddAverage",
				animationSpeed: 0.33,
				easeOutSpeed: 4,
				triggeredBy: { defaultAnim: true },
			}
		]
	},
	server: {
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 }, 
			{ code: "despawn", minPlayerDistance: 12, belowLightLevel: 8, minSeconds: 200 },
			{ code: "health", currenthealth: 5, maxhealth: 5, },
			{ code: "deaddecay", hoursToDecay: 96, decayedBlock: "carcass-tiny" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable", drops: [
					{
						type: "item", 
						code: "fish-raw", 
						quantity: { avg: 2, var: 0 } 
					}
				]
			},
			{ 
				code: "emotionstates",
				states: [
					{ code: "fleeondamage", duration: 10, chance: 1, slot: 0, priority: 1, accumType: "max", whenHealthRelBelow: 0.3 },
					{
						code: "saturated", duration: 1200, chance: 1, slot: 0, priority: 1, accumType: "sum",
						belowTempDuration: 600,
						belowTempThreshold: -5
					},
					{ code: "aggressiveondamage", duration: 30, chance: 1, slot: 2, priority: 2, accumType: "noaccum" },
					{ code: "alarmherdondamage", chance: 1, slot: 1, priority: 1, accumType: "max" }
				]
			},
			{ 
				code: "taskai",
				aitasks: [
					{
						code: "fishoutofwater", 
						priority: 2.5, 
						priorityForCancel: 2.6,
						movespeed: 0.005,
						animation: "flop",
						animationSpeed: 2
					},
					{
						code: "meleeattack",
						entityCodes: ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*", "deer-*-baby", "deer-pudu-*-adult", "deer-water-*-adult", "deer-pampas-*-adult", "deer-redbrocket-*-adult"],
						priority: 2,
						damage: 3,
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 1500,
						maxcooldown: 1500,
						attackDurationMs: 800,
						damagePlayerAtMs: 500,
						animation: "swim",
						animationSpeed: 2,
						sound: "player/stab"
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 2,
						movespeed: 0.06,
						seekingRange: 14,
						animation: "swim",
						animationSpeed: 2,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "wander", 
						priority: 1.2, 
						priorityForCancel: 1.35,
						movespeed: 0.015,
						animationSpeed: 0.9,
						animation: "swim"
					},
					{
						code: "fishmovefast", 
						priority: 1.0, 
						priorityForCancel: 1.5,
						movespeed: 0.045,
						animation: "swimfast",
						animationSpeed: 2.3
					},
					{
						code: "idle",
						priority: 0.9,
						priorityForCancel: 1.5,
						minduration: 1000,
						maxduration: 6000,
						mincooldown: 2000,
						maxcooldown: 20000,
						animation: "eat"
					},
					{
						code: "idle",
						priority: 0.9,
						minduration: 500,
						maxduration: 1000,
						mincooldown: 2000,
						maxcooldown: 30000,
						animation: "idle"
					}
				]
			}
		],
		spawnconditions: {
			worldgen: {
				TriesPerChunk: { avg: 0.5, var: 0 },
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["water-*"],
				minTemp: 4,
				maxTemp: 20
			},
			runtime: {
				group: "hostile",
				chance: 0.01,
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["water-*"],
				minTemp: 4,
				maxTemp: 20
			}
		}
	}
}

I uploaded the entire zip as well. What did I miss? When I ran ModMaker, it did not capture my new texture so I added that folder path. Did I miss something?

piranha.zip

Posted
6 hours ago, Micah Holmes said:
		shape: { base: "entity/water/piranha" },
		texture: { base: "entity/fish/piranha-red" },

You have to add the domain as to where your textures and shapes are stored. Change { base: "entity/fish/piranha-red" } to include the mod domain name, so it becomes { base: "mymodname:entity/fish/piranha-red" }

The same goes for the shape.

Posted (edited)

the screenshot you posted is your fish "item", but the code you posted is your fish "entity"
they are two different things - the item is what shows in inventory/handbook, the entity is what appears in the world.

 

Edited by Spear and Fang
Posted (edited)

I will briefly explain what I did to fix your immediate issue.

So first I want to make sure that the actual shape file and texture file are in your domain - so I may (or may not) have moved your shape.json and texture (png) into your pirahna folder structure (assets\piranha\shapes and assets\piranha\textures).  ideally you want ALL of your mods assets to live in assets\piranha\...this is basically the piranha "domain".

aside: You will notice I removed any folders you had called survival because that isn't a thing.  You will also notice that I left a folder called game in your mod. If you really want to put some of your mod's assets in the game's "domain" (along with all of the vanilla assets) you *can* put them in the game folder.  Not recommended!  But sometimes it is the only way to solve a problem.

Your entity "item" is created via your json patch "survival-itemtypes-creature.json", and its shape and texture are located via this section of that patch. Note the two instances of "piranha:" in the code below.  This points to the shape file and texture file in your mods domain.  Why?  Because you used a patch, your piranha item is actually in the game domain! 

Please also note the two "move" patches I added.  This is because of the "*": entry at the end of the shapeByType section of "game:itemtypes/creature.json". (see sceenshot)
I essentially moved that entry to a temporary location and then immediately moved it back (which forced it to the end of the list.  This will allow your piranha shape entry to actually get loaded.  If I did not move the asterisk entry then that asterisk entry would block your new entry, because the list is processed top down.
 

  {
    "op": "add",
    "path": "/shapeByType/*-piranha",
    "value": {
      "base": "piranha:entity/water/piranha"
    },
    "file": "game:itemtypes/creature.json",
    "side": "Server"
  },
  {
    "op": "move",
    "frompath": "/shapeByType/*",
    "path": "/hax",
    "file": "game:itemtypes/creature.json",
    "side": "Server"
  },
  {
    "op": "move",
    "frompath": "/hax",
    "path": "/shapeByType/*",
    "file": "game:itemtypes/creature.json",
    "side": "Server"
  },
  {
    "op": "add",
    "path": "/texturesByType/*-piranha",
    "value": {
      "all": {
        "base": "piranha:entity/fish/piranha-red"
      }
    },
    "file": "game:itemtypes/creature.json",
    "side": "Server"
  },

Screenshot 2024-11-02 072747.png

Edited by Spear and Fang
Posted

Next up is actually being able to place your piranha in world (which converts the item.json to the entity.json)
I didn't tackle or test that but it can be a little tricky.  I can help with that too if you can't figure it out.

Posted

Here is where we are at now:

 

  • I created a new Creature.json file because that seemed like the correct way to do this/add entity
  • Created a new en.lang file again just seemed like the correct thing to do 
  • moved all the stuff into the "piranha" folder
  • Removed all "patches" folders converted into domain file based structure 

Reviewed all your changes as well. One issue I ran into was in my Creature.Json I have to have a "Skin: base" section for the texture part based on Salmon logic or the game will crash. Not sure what that is all about. Other issue is of course the fish acts like an item and not a entity when i add it in game via creative. So now I think I need to figure out how to get the fish to basically be a fish and not a item. Plus I broke the texture somehow so the fish texture is not working again. Latest version zipped and attached. 

 

/piranha/itemtypes/creature.json

{
	code: "creature",
	class: "ItemCreature",
	maxstacksize: 64,
	variantgroups: [
		{ code: "type", states: [ "piranha" ] }
	],
	shapeByType: {		
		"*-piranha": { base: "piranha:entity/water/piranha" }
	},
	texturesByType: {
		"*-piranha": { skin: {base: "piranha:entity/fish/piranha-red" }}
	},
	creativeinventory: { "general": ["*"], "items": ["*"], "creatures": ["*"] },
	materialDensity: 600,
	guiTransformByType: {
		"creature-piranha": {
			rotate: true,
			translation: { x: 0, y: 0, z: 0 },
			rotation: { x: 177, y: 144, z: -41 },
			origin: { x: 0.49, y: 0.18, z: 0.5 },
			scale: 1.9
		}
	},
	
	tpHandTransformByType: {
		"creature-piranha": {
			translation: { x: -0.8, y: -0.55, z: -0.6 },
			rotation: { x: 0, y: -62, z: 28 },
			scale: 0.62
		}
	},
	
	fpHandTransformByType: {
		"creature-piranha": {
			rotation: { x: 26, y: -65, z: 2 },
			origin: { x: 0.6, y: 0.3, z: 0.6 },
			scale: 1.71
		}
	},
	
	groundTransformByType: {
		"creature-piranha": {
			scale: 4.06
		}
	}
}

 

/piranha/lang/en.json

{
    "item-creature-piranha": "Piranha",
    "item-dead-creature-piranha": "Dead Piranha"
}

 

/piranha/entities/water/piranha.json

{
	code: "piranha",
	class: "EntityFish",
	hitboxSize: { x: 0.5, y: 0.25 },
	eyeHeight: 0.2,
	drops: [],
	habitat: "Underwater",
	client: {
		renderer: "Shape",
		size: 0.7,
		shape: { base: "piranha:entity/water/piranha" },
		texture: { base: "piranha:entity/fish/piranha-red" },
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 0 }, 
			{ code: "interpolateposition" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable" },
			{ code: "despawn", minPlayerDistance: 8, belowLightLevel: 8, minSeconds: 300 },
		],
		animations: [
			{
				code: "hurt",
				animation: "hurt", 
				animationSpeed: 1,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "swim",
				animation: "swim"
			},
			{
				code: "swimfast",
				animation: "swim"
			},
			{
				code: "die",
				animation: "dead",
			},
			{
				code: "flop",
				animation: "flopping"
			},
			{ 
				code: "idle", 
				animation: "idle",
				blendMode: "AddAverage",
				animationSpeed: 0.33,
				easeOutSpeed: 4,
				triggeredBy: { defaultAnim: true },
			}
		]
	},
	server: {
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 }, 
			{ code: "despawn", minPlayerDistance: 12, belowLightLevel: 8, minSeconds: 200 },
			{ code: "health", currenthealth: 5, maxhealth: 5, },
			{ code: "deaddecay", hoursToDecay: 96, decayedBlock: "carcass-tiny" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable", drops: [
					{
						type: "item", 
						code: "fish-raw", 
						quantity: { avg: 2, var: 0 } 
					}
				]
			},
			{ 
				code: "emotionstates",
				states: [
					{ code: "fleeondamage", duration: 10, chance: 1, slot: 0, priority: 1, accumType: "max", whenHealthRelBelow: 0.3 },
					{
						code: "saturated", duration: 1200, chance: 1, slot: 0, priority: 1, accumType: "sum",
						belowTempDuration: 600,
						belowTempThreshold: -5
					},
					{ code: "aggressiveondamage", duration: 30, chance: 1, slot: 2, priority: 2, accumType: "noaccum" },
					{ code: "alarmherdondamage", chance: 1, slot: 1, priority: 1, accumType: "max" }
				]
			},
			{ 
				code: "taskai",
				aitasks: [
					{
						code: "fishoutofwater", 
						priority: 2.5, 
						priorityForCancel: 2.6,
						movespeed: 0.005,
						animation: "flop",
						animationSpeed: 2
					},
					{
						code: "meleeattack",
						entityCodes: ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*", "deer-*-baby", "deer-pudu-*-adult", "deer-water-*-adult", "deer-pampas-*-adult", "deer-redbrocket-*-adult"],
						priority: 2,
						damage: 3,
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 1500,
						maxcooldown: 1500,
						attackDurationMs: 800,
						damagePlayerAtMs: 500,
						animation: "swim",
						animationSpeed: 2,
						sound: "player/stab"
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 2,
						movespeed: 0.06,
						seekingRange: 14,
						animation: "swim",
						animationSpeed: 2,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "wander", 
						priority: 1.2, 
						priorityForCancel: 1.35,
						movespeed: 0.015,
						animationSpeed: 0.9,
						animation: "swim"
					},
					{
						code: "fishmovefast", 
						priority: 1.0, 
						priorityForCancel: 1.5,
						movespeed: 0.045,
						animation: "swimfast",
						animationSpeed: 2.3
					},
					{
						code: "idle",
						priority: 0.9,
						priorityForCancel: 1.5,
						minduration: 1000,
						maxduration: 6000,
						mincooldown: 2000,
						maxcooldown: 20000,
						animation: "eat"
					},
					{
						code: "idle",
						priority: 0.9,
						minduration: 500,
						maxduration: 1000,
						mincooldown: 2000,
						maxcooldown: 30000,
						animation: "idle"
					}
				]
			}
		],
		spawnconditions: {
			worldgen: {
				TriesPerChunk: { avg: 0.5, var: 0 },
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["water-*"],
				minTemp: 4,
				maxTemp: 20
			},
			runtime: {
				group: "hostile",
				chance: 0.01,
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["water-*"],
				minTemp: 4,
				maxTemp: 20
			}
		}
	}
}

 

 

 

 

piranha1.0.1.zip

Posted

Here is where we are at now:

 

  • I created a new Creature.json file because that seemed like the correct way to do this/add entity
  • Created a new en.lang file again just seemed like the correct thing to do 
  • moved all the stuff into the "piranha" folder
  • Removed all "patches" folders converted into domain file based structure 

Reviewed all your changes as well. One issue I ran into was in my Creature.Json I have to have a "Skin: base" section for the texture part based on Salmon logic or the game will crash. Not sure what that is all about. Other issue is of course the fish acts like an item and not a entity when i add it in game via creative. So now I think I need to figure out how to get the fish to basically be a fish and not a item. Plus I broke the texture somehow so the fish texture is not working again. Latest version zipped and attached. 

 

/piranha/itemtypes/creature.json

{
	code: "creature",
	class: "ItemCreature",
	maxstacksize: 64,
	variantgroups: [
		{ code: "type", states: [ "piranha" ] }
	],
	shapeByType: {		
		"*-piranha": { base: "piranha:entity/water/piranha" }
	},
	texturesByType: {
		"*-piranha": { skin: {base: "piranha:entity/fish/piranha-red" }}
	},
	creativeinventory: { "general": ["*"], "items": ["*"], "creatures": ["*"] },
	materialDensity: 600,
	guiTransformByType: {
		"creature-piranha": {
			rotate: true,
			translation: { x: 0, y: 0, z: 0 },
			rotation: { x: 177, y: 144, z: -41 },
			origin: { x: 0.49, y: 0.18, z: 0.5 },
			scale: 1.9
		}
	},
	
	tpHandTransformByType: {
		"creature-piranha": {
			translation: { x: -0.8, y: -0.55, z: -0.6 },
			rotation: { x: 0, y: -62, z: 28 },
			scale: 0.62
		}
	},
	
	fpHandTransformByType: {
		"creature-piranha": {
			rotation: { x: 26, y: -65, z: 2 },
			origin: { x: 0.6, y: 0.3, z: 0.6 },
			scale: 1.71
		}
	},
	
	groundTransformByType: {
		"creature-piranha": {
			scale: 4.06
		}
	}
}

 

/piranha/lang/en.json

{
    "item-creature-piranha": "Piranha",
    "item-dead-creature-piranha": "Dead Piranha"
}

 

/piranha/entities/water/piranha.json

{
	code: "piranha",
	class: "EntityFish",
	hitboxSize: { x: 0.5, y: 0.25 },
	eyeHeight: 0.2,
	drops: [],
	habitat: "Underwater",
	client: {
		renderer: "Shape",
		size: 0.7,
		shape: { base: "piranha:entity/water/piranha" },
		texture: { base: "piranha:entity/fish/piranha-red" },
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 0 }, 
			{ code: "interpolateposition" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable" },
			{ code: "despawn", minPlayerDistance: 8, belowLightLevel: 8, minSeconds: 300 },
		],
		animations: [
			{
				code: "hurt",
				animation: "hurt", 
				animationSpeed: 1,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "swim",
				animation: "swim"
			},
			{
				code: "swimfast",
				animation: "swim"
			},
			{
				code: "die",
				animation: "dead",
			},
			{
				code: "flop",
				animation: "flopping"
			},
			{ 
				code: "idle", 
				animation: "idle",
				blendMode: "AddAverage",
				animationSpeed: 0.33,
				easeOutSpeed: 4,
				triggeredBy: { defaultAnim: true },
			}
		]
	},
	server: {
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 }, 
			{ code: "despawn", minPlayerDistance: 12, belowLightLevel: 8, minSeconds: 200 },
			{ code: "health", currenthealth: 5, maxhealth: 5, },
			{ code: "deaddecay", hoursToDecay: 96, decayedBlock: "carcass-tiny" },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "harvestable", drops: [
					{
						type: "item", 
						code: "fish-raw", 
						quantity: { avg: 2, var: 0 } 
					}
				]
			},
			{ 
				code: "emotionstates",
				states: [
					{ code: "fleeondamage", duration: 10, chance: 1, slot: 0, priority: 1, accumType: "max", whenHealthRelBelow: 0.3 },
					{
						code: "saturated", duration: 1200, chance: 1, slot: 0, priority: 1, accumType: "sum",
						belowTempDuration: 600,
						belowTempThreshold: -5
					},
					{ code: "aggressiveondamage", duration: 30, chance: 1, slot: 2, priority: 2, accumType: "noaccum" },
					{ code: "alarmherdondamage", chance: 1, slot: 1, priority: 1, accumType: "max" }
				]
			},
			{ 
				code: "taskai",
				aitasks: [
					{
						code: "fishoutofwater", 
						priority: 2.5, 
						priorityForCancel: 2.6,
						movespeed: 0.005,
						animation: "flop",
						animationSpeed: 2
					},
					{
						code: "meleeattack",
						entityCodes: ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*", "deer-*-baby", "deer-pudu-*-adult", "deer-water-*-adult", "deer-pampas-*-adult", "deer-redbrocket-*-adult"],
						priority: 2,
						damage: 3,
						damageTier: 2,
						damageType: "SlashingAttack",
						slot: 1,
						mincooldown: 1500,
						maxcooldown: 1500,
						attackDurationMs: 800,
						damagePlayerAtMs: 500,
						animation: "swim",
						animationSpeed: 2,
						sound: "player/stab"
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 2,
						movespeed: 0.06,
						seekingRange: 14,
						animation: "swim",
						animationSpeed: 2,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "wander", 
						priority: 1.2, 
						priorityForCancel: 1.35,
						movespeed: 0.015,
						animationSpeed: 0.9,
						animation: "swim"
					},
					{
						code: "fishmovefast", 
						priority: 1.0, 
						priorityForCancel: 1.5,
						movespeed: 0.045,
						animation: "swimfast",
						animationSpeed: 2.3
					},
					{
						code: "idle",
						priority: 0.9,
						priorityForCancel: 1.5,
						minduration: 1000,
						maxduration: 6000,
						mincooldown: 2000,
						maxcooldown: 20000,
						animation: "eat"
					},
					{
						code: "idle",
						priority: 0.9,
						minduration: 500,
						maxduration: 1000,
						mincooldown: 2000,
						maxcooldown: 30000,
						animation: "idle"
					}
				]
			}
		],
		spawnconditions: {
			worldgen: {
				TriesPerChunk: { avg: 0.5, var: 0 },
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["water-*"],
				minTemp: 4,
				maxTemp: 20
			},
			runtime: {
				group: "hostile",
				chance: 0.01,
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["water-*"],
				minTemp: 4,
				maxTemp: 20
			}
		}
	}
}

 

 

 

 

 

Update:

I got it fixed one line of code was off. I'll post this in mods but i plan on adding more fish later

 

piranha1.0.1.zip

piranha1.0.1.zip

Posted (edited)

I couldn't tell which one was the latest version, so I downloaded the bottom one.
Tested it in game and it seems to be working perfectly. congrats

One issue I ran into was in my Creature.Json I have to have a "Skin: base"

This is fine. The game is expecting something there. I think "all" is often used rather than "skin" in these cases, but it shouldn't matter

Other issue is of course the fish acts like an item and not a entity when i add it in game via creative.

You will never have an "entity" in an inventory.  It's always an item in these cases.  So if you throw it on the ground it's an item, if you right click place it it magically becomes an entity.

Screenshot 2024-11-02 155730.png

Edited by Spear and Fang
Posted (edited)

just keep an eye on your logs/server-main.txt and logs/client-main.txt while modding
 

2.11.2024 15:51:16 [Warning] Entity with code piranha:piranha has defined InsideBlockCodes for its spawn conditions, but none of these blocks exists, entity is unlikely to spawn.

This is just telling you to fix your spawn conditions at the bottom of your entity.json.  Since water blocks are vanilla, you need the "game:" prefix in a couple of places.

insideBlockCodes: ["game:water-*"],
Edited by Spear and Fang
Posted

I think this fixes the spawn issue:

spawnconditions: {
			worldgen: {
				TriesPerChunk: { avg: 0.5, var: 0 },
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["game:water-*"],
				minTemp: 4,
				maxTemp: 20
			},
			runtime: {
				group: "hostile",
				chance: 0.01,
				tryOnlySurface: true,
				minLightLevel: 3,
				groupSize: { dist: "verynarrowgaussian", avg: 2, var: 3 },
				insideBlockCodes: ["game:water-*"],
				minTemp: 4,
				maxTemp: 20
			}

I also added seek entity in my code so now it will seek out players. I had to lower there damage. They hit too hard. I also added "alertheard" attribute:

{
						code: "seekentity",
						entityCodes: ["player"],
						priority: 1.5,
						mincooldown: 1500,
						maxcooldown: 1500,
						movespeed: 0.045,
						seekingRange: 15,
						maxFollowTime: 20,
						animationSpeed: 2.3,
						alarmHerd: true,
						animation: "swimfast"
					}

alarmherd seems to make them all swarm a player in the water. so you know ... dont go in the water lol Here is final copy. Please feel free to review it and test. They are very nasty little fish 

 

 

 

piranha1.0.1.zip

  • 7 months later...
Posted (edited)
On 11/9/2024 at 9:51 AM, Micah Holmes said:

Going to make some more fish for this mod. Any fish requests? Please post. Thanks 

Glad you made this mod, spawning near the equator has made fishing non-existent until I installed this and tweaked the min and max temperatures that the piranha can spawn at (21c to 30c).

If I could make a request, could you try making some catfish? Was testing the NA Catfish mod with tweaked temp values to simulate African Sharptooth catfish (Clarias gariepinus) but whenever I try to spear them the game crashes, a bug with the hurt animation I think.

Bass would be great too, they have a diverse temperature range going from subpolar to subtropical, largemouth and smallmouth for freshwater and sea bass for saltwater.

Thanks

Edited by Chalki
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.