#mob killing issues

1 messages · Page 1 of 1 (latest)

supple shell
#

When I kill a mob I get 2 command blocks instead of 1

rotund geyser
#
on death:
  if attacker is player:
    give player 2 of command block```
supple shell
#

I want 1 command block ()

#

ill provide the code in a sec

rotund geyser
#

k

supple shell
#
options:
    itemPicker: chain command block of sharpness 1 named "&7Item Picker" with nbt compound from "{Hideflags:127}"
    headShard: player skull named "&6Head Shard"
    mendingBook: enchanted book with nbt compound from "{StoredEnchantments:[{id:""minecraft:mending"",lvl:1s}]}"
    reviveShard: amethyst shard named "&eRevive Shard"

on load:
    set {_a} to {@headShard}
    set {_n} to netherite ingot
    set {_r} to {@reviveShard}
    register new shaped recipe for {_r} using {_a}, {_a}, {_a}, {_a}, {_n}, {_a}, {_a}, {_a} and {_a} with id "custom_recipes:reviveshard"

command /getItemPicker:
    permission: op
    trigger:
        give 1 of {@itemPicker} to player

on death:
    set {_killer} to attacker
    if {_killer} isn't set:
        stop
    
    give 1 of {@itemPicker} to {_killer}
 
on right click:
    if player's tool = {@itemPicker}:
        set metadata tag "item" of player to a chest inventory with 1 rows named "&6Pick an Item."
        set {_inv} to metadata tag "item" of player
        
        # - items in gui
        set slot 0 of {_inv} to {@mendingBook}
        set slot 1 of {_inv} to {@headShard}
        
        open {_inv} to player

on inventory click:
    if event-inventory = (metadata tag "item" of player):
        cancel event
        if event-item is set:
            if player has enough space for event-item:
                give 1 of event-item to player
            else:
                drop 1 of event-item at player
            close player's inventory
            remove 1 of {@itemPicker} from player's inventory
#

Also mobs drop command blocks

rotund geyser
#

Why

supple shell
#

no clue

#

mobs shouldnt

rotund geyser
#

Lol

#

Players should?

supple shell
#

yes

#

and only 1 command block lol

rotund geyser
#

if victim is player:

supple shell
#

can you edit the code and fix it?

rotund geyser
#

Uh

#

Nrn I’m on a phone

supple shell
# rotund geyser if victim is player:
options:
    itemPicker: chain command block of sharpness 1 named "&7Item Picker" with nbt compound from "{Hideflags:127}"
    headShard: player skull named "&6Head Shard"
    mendingBook: enchanted book with nbt compound from "{StoredEnchantments:[{id:""minecraft:mending"",lvl:1s}]}"
    reviveShard: amethyst shard named "&eRevive Shard"

on load:
    set {_a} to {@headShard}
    set {_n} to netherite ingot
    set {_r} to {@reviveShard}
    register new shaped recipe for {_r} using {_a}, {_a}, {_a}, {_a}, {_n}, {_a}, {_a}, {_a} and {_a} with id "custom_recipes:reviveshard"

command /getItemPicker:
    permission: op
    trigger:
        give 1 of {@itemPicker} to player

if victim is player:
on death:
    set {_killer} to attacker
    if {_killer} isn't set:
        stop
    
    give 1 of {@itemPicker} to {_killer}
 
on right click:
    if player's tool = {@itemPicker}:
        set metadata tag "item" of player to a chest inventory with 1 rows named "&6Pick an Item."
        set {_inv} to metadata tag "item" of player
        
        # - items in gui
        set slot 0 of {_inv} to {@mendingBook}
        set slot 1 of {_inv} to {@headShard}
        
        open {_inv} to player

on inventory click:
    if event-inventory = (metadata tag "item" of player):
        cancel event
        if event-item is set:
            if player has enough space for event-item:
                give 1 of event-item to player
            else:
                drop 1 of event-item at player
            close player's inventory
            remove 1 of {@itemPicker} from player's inventory
#

would this work?

rotund geyser
#

Idk try it

#

Oh

#

No

#

On death: if victim is player: drop X at victim

proper dock
#

hmmmmmm

#

no.

supple shell
#

wdym no

rotund geyser