#Custom Item (flintlock_pistol) behavior help thread

1 messages · Page 1 of 1 (latest)

runic silo
#

I’m making a pirate addon, and part of that includes a range of flintlock guns. I’m starting with the flintlock pistol, but I’m relatively new with defining components tags and scripts.

I currently have the item, model, and texture, in game; the rest of the behaviors I have no idea how to begin.

i also need to make the gun appear in the hand correctly in first person without messing up the third person view in multiplayer

attached photos -

  • flintlock_pistol model
  • item behavior json
  • 3rd person
  • first person
runic silo
#

@potent bear can i dm you in relation to this? i was sent your way by Vybes

#

updated jank item json

potent bear
#

We dont use minecraft:shooter on guns

potent bear
runic silo
runic silo
# potent bear We dont use minecraft:shooter on guns

i should mention i got these components from someone else’s template they shared for reference, i don’t fully understand the fundamentals that would make a gun work - - i appreciate any documentation you could guide me to, i’m a quick learner!

as long as i have the tools and a reference i can fill in most of the learning myself

potent bear
#

Make a CUSTOM throwable projectile
I suggest just using bridge preset for snowballs lol
Delete the item version keep the thrown entity

Go to player.json make a component_group that is minecraft:spawn_entity
Make a event that would trigger that component group

#

Then make a animation controller for bp

#

Make a state that is inactive

#

Then active
Then fire

#

When you hold the item

#

It will transistion to fire when you use the item

#

For active
It transistion to fire when u use item

#

On the fire state on entry it triggers the event(where the gun shoots)

#

The event will trigger a spawn entity component group

#

Ones the fire state ends it transistions to active(if u have ammo) and transistions to empty

#

Ill give u a bp sample of my acs

#

Sample

#

If u noticed theres scoreboard == and !scoreboard >=

#

Well its for a scoreboard system

#

Scoreboard system counts the ammo

#

Tho u can use replace item if you want with empty states

#

Since yours is single shot

#

I suggest making it a replace item from commands or function

#

Now before i go back to the player.json

#

U need to make a reload state

#

Match the reload state animation length(server anims) with rp anims length

#

To trigger

#

Make a entity property

#

Make a property section on player.json

#

On description part

#

Up to you what way u want but i suggest using bool

#

With client sync on

#

Now back to connecting anims controller and player.json

#

Put it on scripts then animate and put the animation controller

#

Theres a option that either u put is as a string or something u can have a query on

#

Put
query.is_item_name_any('slot.weapon.mainhand','ur item')

#

So that it triggers when u only hold the item

#

Now this just the bp part

#

I wont teach u the rp with hands for now(im lazy typing)
Try finishing bp first

runic silo
#

thank you!! im about to read thru but i appreciate this!

queen fog
runic silo
queen fog
runic silo
#

oh ye ofc

runic silo