• 0

    posted a message on Scoreboard objective to detect button press

    What I'm basically trying to do is have one button for rolling dice, and have a system that only allows the player who's turn it is to successfully roll (they'd be flagged with a score objective or a tag when it was their turn). The problem becomes if players are crowding around the "dice" button, using an entity to detect player proximity can lead to false negatives/positives... being able to use the stat to detect who actually pressed the button would have been the best way to do it


    Thanks though, I'll just have to think on this a little more.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard objective to detect button press

    Is there any way to create a scoreboard objective to detect the player pressing a button? I tired using stat.useItem:

    /scoreboard objectives add PressButton stat.useItem.minecraft.stone_button

    But this only detects when the player places a button.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Make Scoreboard Objective stat.useItem.minecraft.bow Track Mobs

    I've actually figured out a partial work around, but that still leaves the question of whether this is a bug or not. Does anyone know if .stat. objectives are only supposed to work for players, or should hey work for mobs as well?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Make Scoreboard Objective stat.useItem.minecraft.bow Track Mobs

    I have a scoreboard objective defined as such:

    /scoreboard objectives add ShootBow stat.useItem.minecraft.bow

    This tracks nicely for players, but won't track for skeletons. Is there a way to make it work for them?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard: Detect player eating item

    Was spelling it wrong and didn't notice..... <_<


    Thanks

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard: Detect player eating item

    Is there a scoreboard "stat.*" objective type that tracks when a player eats something? I tried using "stat.useItem.*" with various food names/ID #s, but haven't been able to successfully create an objective.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Change display name/lore of a dropped item

    That's done it, thanks! On a side note is there a benefit to using tags over a regular dummy score?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Change display name/lore of a dropped item

    I'm trying to create garlic plants for a mini-game by retexturing/renaming beets, but I'm having a little trouble. I have the custom textures working fine, the problem is renaming the dropped beets when the blocks are broken:


    I've got a simple fast clock system to flag only beets with a score and then use entitydata to change their display name/lore. The commands indicate they're executing successfully, but when the player picks up the item, the new name/lore isn't showing


    /scoreboard players add @e[type=item] BeetItem 1 {Item:{id:minecraft:beetroot}}
    /entitydata @e[type=item,score_BeetItem=1] {display:{Name:"Garlic",Lore:[Good for repelling vampires,Bad for your breath]}}

    At first i thought maybe the information was being lost when the item was added to the players inventory, but if you use this command to directly give you the item, you can drop it and pick it back up and the name/lore is saved:


    /give @p minecraft:beetroot 1 0 {display:{Name:"Garlic",Lore:[Good for repelling vampires,Bad for your breath]}}

    Is there something obvious I'm missing?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Grappling Hook in Minecraft

    That's not how objectives work. "stat.***" is an objective type, like how we specified "Landed" as type "dummy" in the original command. You have to define a new objective:

    /scoreboard objectives add UseHook stat.useItem.346

    This will automatically track players use of fishing rods. Then you put "score_UseHook_min=1" in the target selector of your other commands. Don't forget to add another command that resets UseHook to 0 once the player has been teleported.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Grappling Hook in Minecraft

    I'd need to see the commands you're writing to offer an actual answer. The only difference between @e and @a is that @a targets only players, while @e targets everything.


    I haven't been able to think of a perfect solution to adapt this to multiplayer. One option is to add a new score that tracks fishingrod use (stat.useItem), then reset the score once the player is within range of the fishing bob. This would help reduce the chance of teleporting the wrong player, but there's the still the chance of having two people cast simultaneously nearby each other. Otherwise, I don't know if this is possible to do perfectly without mods/plugins.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Grappling Hook in Minecraft

    Here's a quick idea I threw together. First, create the scoreboard objective:

    /scoreboard objectives add Landed dummy

    This will be our flag for a landed grappling hook (fishing bob), so you are only teleported to the hook once it lands.

    Next, create a chain of repeating commandblocks:

    /scoreboard players set @e[type=!Player,name=unknown] Landed 1 {Motion:[0.0,0.0,0.0]}
    /execute @e[type=!Player,name=unknown,score_Landed_min=1] ~ ~ ~ teleport @p ~ ~ ~ 
    /kill @e[type=!Player,name=unknown,score_Landed_min=1]

    The first will flag the hook (bob) when it lands, the second will teleport the player to the hook only once it's landed, and the third will kill the landed hook (so you aren't stuck infinitely teleporting to it).


    Note: This design is limited in several ways:


    One, all fishing rods will act like grappling hooks. You will need to distinguish grappling hooks from the rest. Maybe add another score called "HoldingGrapple", then add two more commands to the command chain; the first would reset the HoldingGrapple score for all players, then the second would flag the player (set the score) if they're holding a fishing rod named "grappling hook". Finally, add that score requirement as part of the target selectors in the other above commands so they only trigger if the player is holding a grappling hook).


    Two, you will not be able to grapple onto water blocks or moving entities. This system relies on the hook coming to a complete stop before you are teleported to it, and the bob will not have a motion tag of 0,0,0 on an entity that's moving, or in water blocks (it continuously bobs in water).


    Three, this system will not work perfectly in multiplayer maps if multiple people are casting in close proximity (this system would just teleport the closest person to where the bob landed, which would not necessarily be the person who cast it).


    Four, the hook won't naturally degrade and eventually break like regular tools. This may not be a problem for your specific intent, though. You'd have to somehow use the score system to detect when a player had cast the rod, then invisibly track it's health and destroy the tool when it had "broken".


    Obviously there's room for improvement, but this proves it can be done. Let me know if you come up with any ideas to improve.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Spawn slower moving bat

    Neat, that actually kind of worked, thanks!


    It would still be nice to have more precise control over speed, but maybe I can make this work.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command to break a furnace & drop its contents

    This actually doesn't work; the name of an item is different from the type of an item, so this command will simply kill all dropped items that weren't named "furnace" (regardless of whether they actually are a furnace or not). For anyone wondering, you need to use the scoreboard system to flag items based on their type, then delete items based on whether they were flagged or not. For example:


    /scoreboard objectives add DeleteMe dummy
    
    /scoreboard players set @e[type=item] DeleteMe 1 {Item:{id:minecraft:furnace}}
    
    /kill @e[type=item,score_DeleteMe_min=1]
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command to break a furnace & drop its contents

    Perfect! Didn't even know that was a thing, thanks!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command to break a furnace & drop its contents

    Is there a way to break a furnace with commands but have it drop its items? I'm making a time-based mini-game where the furnace will disappear at the end of the event, but I don't want the player to lose whatever is in the furnace if they're not done.

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.